Accepting request 1000398 from home:Andreas_Schwab:Factory

- nscd-netlink-cache-invalidation.patch: nscd: Fix netlink cache
  invalidation if epoll is used (boo#1199964, BZ #29415)

OBS-URL: https://build.opensuse.org/request/show/1000398
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=626
This commit is contained in:
Andreas Schwab 2022-08-31 07:58:47 +00:00 committed by Git OBS Bridge
parent ea78a116b4
commit c561de7c3a
3 changed files with 57 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 24 09:29:02 UTC 2022 - Fabian Vogt <fvogt@suse.com>
- nscd-netlink-cache-invalidation.patch: nscd: Fix netlink cache
invalidation if epoll is used (boo#1199964, BZ #29415)
-------------------------------------------------------------------
Mon Aug 15 09:21:34 UTC 2022 - Andreas Schwab <schwab@suse.de>

View File

@ -279,12 +279,14 @@ Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-OPENSUSE glibcextract.py: Add compile_c_snippet
# PATCH-FIX-UPSTREAM glibcextract.py: Add compile_c_snippet
Patch1000: glibcextract-compile-c-snippet.patch
# PATCH-FIX-OPENSUSE linux: Mimic kernel definition for BLOCK_SIZE
# PATCH-FIX-UPSTREAM linux: Mimic kernel definition for BLOCK_SIZE
Patch1001: sys-mount-kernel-definition.patch
# PATCH-FIX-OPENSUSE linux: Fix sys/mount.h usage with kernel headers
# PATCH-FIX-UPSTREAM linux: Fix sys/mount.h usage with kernel headers
Patch1002: sys-mount-usage.patch
# PATCH-FIX-UPSTREAM nscd: Fix netlink cache invalidation if epoll is used (BZ #29415)
Patch1003: nscd-netlink-cache-invalidation.patch
###
# Patches awaiting upstream approval
@ -512,6 +514,7 @@ library in a cross compilation setting.
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
%endif
%patch2000 -p1

View File

@ -0,0 +1,45 @@
From 02ca25fef2785974011e9c5beecc99b900b69fd7 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Wed, 27 Jul 2022 11:44:07 +0200
Subject: [PATCH] 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 <fvogt@suse.de>
---
nscd/connections.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
else
--
2.37.2