public inbox for
help / color / mirror / Atom feed
* [glibc/arm/morello/main] nscd: Fix netlink cache invalidation if epoll is used [BZ #29415]
@ 2022-10-26 15:06 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2022-10-26 15:06 UTC (permalink / raw)
  To: glibc-cvs;h=c399271c10bd00714504e8d4dfbec8aebf996dd4

commit c399271c10bd00714504e8d4dfbec8aebf996dd4
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:
    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)

 NEWS               | 1 +
 nscd/connections.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 10a7613f09..9360596fcc 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Security related changes:
 The following bugs are resolved with this release:
   [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
+  [29415] nscd: Fix netlink cache invalidation if epoll is used
   [29446] _dlopen now ignores dl_caller argument in static mode
   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
   [29490] alpha: New __brk_call implementation is broken
diff --git a/nscd/connections.c b/nscd/connections.c
index 61d1674eb4..531d2e83df 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -2284,7 +2284,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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-26 15:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 15:06 [glibc/arm/morello/main] nscd: Fix netlink cache invalidation if epoll is used [BZ #29415] Szabolcs Nagy

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).