diff options
Diffstat (limited to 'source/l/glibc')
-rwxr-xr-x | source/l/glibc/glibc.SlackBuild | 7 | ||||
-rw-r--r-- | source/l/glibc/patches/0001-nsswitch-return-result-when-nss-database-is-locked.patch | 47 |
2 files changed, 53 insertions, 1 deletions
diff --git a/source/l/glibc/glibc.SlackBuild b/source/l/glibc/glibc.SlackBuild index 4c15cdb3c..5a0e4e929 100755 --- a/source/l/glibc/glibc.SlackBuild +++ b/source/l/glibc/glibc.SlackBuild @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=glibc VERSION=${VERSION:-$(echo glibc-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} CHECKOUT=${CHECKOUT:-""} -BUILD=${BUILD:-2} +BUILD=${BUILD:-1} # I was considering disabling NSCD, but MoZes talked me out of it. :) #DISABLE_NSCD=" --disable-nscd " @@ -223,6 +223,11 @@ mkdir build-glibc-$VERSION cd build-glibc-$VERSION || exit 1 echo "BUILDING DAS NPTL GLIBC" +# We are setting the variable below so that x86 ISA level is not included +# in shared libraries. Without this, glibc compiled with -march= may not +# run on some CPUs that it should be able to support. Needed for glibc-2.33. +# FIXME: revisit this with future glibc releases! +libc_cv_include_x86_isa_level=no \ CFLAGS="-g $OPTIMIZ" \ ../configure \ --prefix=/usr \ diff --git a/source/l/glibc/patches/0001-nsswitch-return-result-when-nss-database-is-locked.patch b/source/l/glibc/patches/0001-nsswitch-return-result-when-nss-database-is-locked.patch new file mode 100644 index 000000000..458369251 --- /dev/null +++ b/source/l/glibc/patches/0001-nsswitch-return-result-when-nss-database-is-locked.patch @@ -0,0 +1,47 @@ +From c3479fb7939898ec22c655c383454d6e8b982a67 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyfox@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@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 |