[arch-commits] Commit in glibc/trunk (PKGBUILD bz27343.patch)

Allan McRae allan at archlinux.org
Sat Feb 6 00:40:20 UTC 2021


    Date: Saturday, February 6, 2021 @ 00:40:19
  Author: allan
Revision: 407533

upgpkg: glibc 2.33-3: fix initgroups segfault

Added:
  glibc/trunk/bz27343.patch
Modified:
  glibc/trunk/PKGBUILD

---------------+
 PKGBUILD      |   18 +++++++-----------
 bz27343.patch |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-02-05 21:38:21 UTC (rev 407532)
+++ PKGBUILD	2021-02-06 00:40:19 UTC (rev 407533)
@@ -7,7 +7,7 @@
 pkgbase=glibc
 pkgname=(glibc lib32-glibc)
 pkgver=2.33
-pkgrel=2
+pkgrel=3
 arch=(x86_64)
 url='https://www.gnu.org/software/libc'
 license=(GPL LGPL)
@@ -20,7 +20,8 @@
         locale.gen.txt
         locale-gen
         lib32-glibc.conf
-        sdt.h sdt-config.h)
+        sdt.h sdt-config.h
+        bz27343.patch)
 validpgpkeys=(7273542B39962DF7B299931416792B4EA25340F8 # Carlos O'Donell
               BC7C7372637EC10C57D7AA6579C43DFBF1CF2187) # Siddhesh Poyarekar
 md5sums=('390bbd889c7e8e8a7041564cb6b27cca'
@@ -29,7 +30,8 @@
          '476e9113489f93b348b21e144b6a8fcf'
          '6e052f1cb693d5d3203f50f9d4e8c33b'
          '91fec3b7e75510ae2ac42533aa2e695e'
-         '680df504c683640b02ed4a805797c0b2')
+         '680df504c683640b02ed4a805797c0b2'
+         'cfe57018d06bf748b8ca1779980fef33')
 
 prepare() {
   mkdir -p glibc-build lib32-glibc-build
@@ -37,14 +39,8 @@
   [[ -d glibc-$pkgver ]] && ln -s glibc-$pkgver glibc 
   cd glibc
 
-  local i; for i in ${source[@]}; do
-    case ${i%::*} in
-      *.patch)
-        echo "  -> Applying ${i}"
-        patch -p1 -i "$srcdir/${i}"
-        ;;
-    esac
-  done
+  # commit c3479fb7939898ec22c655c383454d6e8b982a67
+  patch -p1 -i "$srcdir"/bz27343.patch
 }
 
 build() {

Added: bz27343.patch
===================================================================
--- bz27343.patch	                        (rev 0)
+++ bz27343.patch	2021-02-06 00:40:19 UTC (rev 407533)
@@ -0,0 +1,48 @@
+From c3479fb7939898ec22c655c383454d6e8b982a67 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox at gentoo.org>
+Date: Fri, 5 Feb 2021 07:32:18 +0000
+Subject: [PATCH] nsswitch: return result when nss database is locked [BZ
+ #27343]
+
+Before the change nss_database_check_reload_and_get() did not populate
+the '*result' value when it returned success in a case of chroot
+detection. This caused initgroups() to use garage pointer in the
+following test (extracted from unbound):
+
+```
+
+int main() {
+    // load some NSS modules
+    struct passwd * pw = getpwnam("root");
+
+    chdir("/tmp");
+    chroot("/tmp");
+    chdir("/");
+    // access nsswitch.conf in a chroot
+    initgroups("root", 0);
+}
+```
+
+Reviewed-by: DJ Delorie <dj at redhat.com>
+---
+ nss/nss_database.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/nss/nss_database.c b/nss/nss_database.c
+index cf0306adc4..e1bef6bd75 100644
+--- a/nss/nss_database.c
++++ b/nss/nss_database.c
+@@ -398,8 +398,9 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
+ 	  && (str.st_ino != local->root_ino
+ 	      ||  str.st_dev != local->root_dev)))
+     {
+-      /* Change detected; disable reloading.  */
++      /* Change detected; disable reloading and return current state.  */
+       atomic_store_release (&local->data.reload_disabled, 1);
++      *result = local->data.services[database_index];
+       __libc_lock_unlock (local->lock);
+       __nss_module_disable_loading ();
+       return true;
+-- 
+2.27.0
+



More information about the arch-commits mailing list