public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 0/5] Race condition in /etc/resolv.conf reloading (bug 25420)
Date: Tue, 21 Jan 2020 18:41:00 -0000	[thread overview]
Message-ID: <cover.1579631655.git.fweimer@redhat.com> (raw)

I've split this up for easier review.  The actual changes are quite
small, and I think they clean up the code a bit.

I did not add a test case because the race is apparently quite hard to
hit.  (I still have to try the reproducer from the reporter.)

Not sure if that is still glibc 2.31 material, but it should be quite
backportable.

Thanks,
Florian

Florian Weimer (5):
  Add internal <file_change_detection.h> header file
  resolv: Use <file_change_detection.h> in __resolv_conf_get_current
  resolv: Fix file handle leak in __resolv_conf_load [BZ #25429]
  resolv: Enhance __resolv_conf_load to capture file change data
  resolv: Fix ABA race in /etc/resolv.conf change detection [BZ #25420]

 include/file_change_detection.h | 140 ++++++++++++++++++++++
 io/Makefile                     |   2 +-
 io/tst-file_change_detection.c  | 206 ++++++++++++++++++++++++++++++++
 resolv/res_init.c               |  22 +++-
 resolv/resolv_conf.c            |  60 ++++------
 resolv/resolv_conf.h            |  10 +-
 6 files changed, 392 insertions(+), 48 deletions(-)
 create mode 100644 include/file_change_detection.h
 create mode 100644 io/tst-file_change_detection.c

-- 
2.24.1

             reply	other threads:[~2020-01-21 18:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 18:41 Florian Weimer [this message]
2020-01-21 18:41 ` [PATCH 1/5] Add internal <file_change_detection.h> header file Florian Weimer
2020-02-10 19:47   ` Adhemerval Zanella
2020-02-10 19:58     ` Florian Weimer
2020-02-10 20:57       ` Adhemerval Zanella
2020-01-21 18:42 ` [PATCH 2/5] resolv: Use <file_change_detection.h> in __resolv_conf_get_current Florian Weimer
2020-02-13 20:53   ` Adhemerval Zanella
2020-01-21 18:42 ` [PATCH 3/5] resolv: Fix file handle leak in __resolv_conf_load [BZ #25429] Florian Weimer
2020-02-13 21:01   ` Adhemerval Zanella
2020-02-13 21:08     ` Florian Weimer
2020-02-13 21:30       ` Adhemerval Zanella
2020-01-21 18:42 ` [PATCH 4/5] resolv: Enhance __resolv_conf_load to capture file change data Florian Weimer
2020-02-13 21:33   ` Adhemerval Zanella
2020-01-21 21:28 ` [PATCH 5/5] resolv: Fix ABA race in /etc/resolv.conf change detection [BZ #25420] Florian Weimer
2020-02-13 21:59   ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1579631655.git.fweimer@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).