From f9ff3ef63b7acd272742f62b009df8bc57e83a2b Mon Sep 17 00:00:00 2001 From: Arjun Shankar Date: Mon, 26 Jun 2023 16:53:50 +0200 Subject: [PATCH] resolv_conf: release lock on allocation failure (#2213908) Resolves: #2213908 --- glibc-rh2213908.patch | 27 +++++++++++++++++++++++++++ glibc.spec | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 glibc-rh2213908.patch diff --git a/glibc-rh2213908.patch b/glibc-rh2213908.patch new file mode 100644 index 0000000..73392a4 --- /dev/null +++ b/glibc-rh2213908.patch @@ -0,0 +1,27 @@ +commit abcf8db7fa46b73fd5b8193ce11f9312301b84c7 +Author: Andreas Schwab +Date: Wed Jun 7 11:21:48 2023 +0200 + + 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 9010bf0ea4d84557..aab79e9f4e323df9 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 cb6a585..fb44ff2 100644 --- a/glibc.spec +++ b/glibc.spec @@ -155,7 +155,7 @@ end \ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: 69%{?dist} +Release: 70%{?dist} # In general, GPLv2+ is used by programs, LGPLv2+ is used for # libraries. @@ -723,6 +723,7 @@ Patch484: glibc-upstream-2.34-397.patch # All future backports need maintain CentOS 9 Stream and RHEL 9 only. Patch485: glibc-rh2215368.patch +Patch486: glibc-rh2213908.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2880,6 +2881,9 @@ update_gconv_modules_cache () %endif %changelog +* Mon Jun 26 2023 Arjun Shankar - 2.34-70 +- resolv_conf: release lock on allocation failure (#2213908) + * Mon Jun 26 2023 Arjun Shankar - 2.34-69 - strerror must not return NULL (#2215368)