From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 4D0CE385142A; Tue, 6 Sep 2022 16:32:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D0CE385142A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662481924; bh=Ifb9hDr9gVY+TsC2TbJyqbzXTPV1R+dntYrP0Kt9ed4=; h=From:To:Subject:Date:From; b=oHge+5YtaoRDcE2QnWMyQffiVr0ae79RoKhDixR0yC3KaayfHLJkSJ44+k2pm3SUb 9CULd2sKtlj0ePBEihtXXN//ReZ4aN/LEIqbPXZGcdzZlifMrsXA5Te/XZ0sHYap3p y7oUVoLYdnyWkbu5KOrrrl3yVrvSYb0DUWIOwTwk= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.34/master] nscd: Fix netlink cache invalidation if epoll is used [BZ #29415] X-Act-Checkin: glibc X-Git-Author: Fabian Vogt X-Git-Refname: refs/heads/release/2.34/master X-Git-Oldrev: b41c535f46e7e7bbd8ff2ac68b94c2348e2f66e4 X-Git-Newrev: 2b3d020055bea4fbbfc0ca2362d46038487c6dfd Message-Id: <20220906163204.4D0CE385142A@sourceware.org> Date: Tue, 6 Sep 2022 16:32:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b3d020055bea4fbbfc0ca2362d46038487c6dfd commit 2b3d020055bea4fbbfc0ca2362d46038487c6dfd Author: Fabian Vogt Date: Wed Jul 27 11:44:07 2022 +0200 nscd: Fix netlink cache invalidation if epoll is used [BZ #29415] Processes cache network interface information such as whether IPv4 or IPv6 are enabled. This is only checked again if the "netlink timestamp" provided by nscd changed, which is triggered by netlink socket activity. However, in the epoll handler for the netlink socket, it was missed to assign the new timestamp to the nscd database. The handler for plain poll did that properly, copy that over. This bug caused that e.g. processes which started before network configuration got unusuable addresses from getaddrinfo, like IPv6 only even though only IPv4 is available: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041 It's a bit hard to reproduce, so I verified this by checking the timestamp on calls to __check_pf manually. Without this patch it's stuck at 1, now it's increasing on network changes as expected. Signed-off-by: Fabian Vogt (cherry picked from commit 02ca25fef2785974011e9c5beecc99b900b69fd7) Diff: --- NEWS | 1 + nscd/connections.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ef7671b2f6..4a2531aa97 100644 --- a/NEWS +++ b/NEWS @@ -113,6 +113,7 @@ The following bugs are resolved with this release: [29211] libc: __open_catalog is not y2038 aware [29213] libc: gconv_parseconfdir is not y2038 aware [29214] nptl: pthread_setcanceltype fails to set type + [29415] nscd: Fix netlink cache invalidation if epoll is used [29446] _dlopen now ignores dl_caller argument in static mode [29490] alpha: New __brk_call implementation is broken [29528] elf: Call __libc_early_init for reused namespaces diff --git a/nscd/connections.c b/nscd/connections.c index 3f0bda4e97..bc941715cf 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -2285,7 +2285,8 @@ main_loop_epoll (int efd) sizeof (buf))) != -1) ; - __bump_nl_timestamp (); + dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP] + = __bump_nl_timestamp (); } # endif else