From a9c42b37f5fbbdaea19b003655344e192db11417 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Mon, 3 Jul 2023 19:07:30 -0400 Subject: [PATCH] resolv_conf: release lock on allocation failure (#2213909) Resolves: #2213909 --- glibc-rh2213909.patch | 26 ++++++++++++++++++++++++++ glibc.spec | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 glibc-rh2213909.patch diff --git a/glibc-rh2213909.patch b/glibc-rh2213909.patch new file mode 100644 index 0000000..d18d5c8 --- /dev/null +++ b/glibc-rh2213909.patch @@ -0,0 +1,26 @@ +From abcf8db7fa46b73fd5b8193ce11f9312301b84c7 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Wed, 7 Jun 2023 11:21:48 +0200 +Subject: resolv_conf: release lock on allocation failure (bug 30527) + +When the initial allocation of global fails, the local lock is left +locked. + +Reported by Steffen Lammel of SAP HANA development. + +diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c +index bd5890773b..8bc9edc634 100644 +--- a/resolv/resolv_conf.c ++++ b/resolv/resolv_conf.c +@@ -93,7 +93,10 @@ get_locked_global (void) + { + global_copy = calloc (1, sizeof (*global)); + if (global_copy == NULL) +- return NULL; ++ { ++ __libc_lock_unlock (lock); ++ return NULL; ++ } + atomic_store_relaxed (&global, global_copy); + resolv_conf_array_init (&global_copy->array); + } diff --git a/glibc.spec b/glibc.spec index c52680c..8100fd1 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.28 %define glibcversion 2.28 -%define glibcrelease 228%{?dist} +%define glibcrelease 229%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -1037,6 +1037,7 @@ Patch844: glibc-rh2172949.patch Patch845: glibc-rh2180155-1.patch Patch846: glibc-rh2180155-2.patch Patch847: glibc-rh2180155-3.patch +Patch848: glibc-rh2213909.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2867,6 +2868,9 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog +* Mon Jul 3 2023 DJ Delorie - 2.28-229 +- resolv_conf: release lock on allocation failure (#2213909) + * Mon May 22 2023 Florian Weimer - 2.28-228 - gmon: Various bug fixes (#2180155)