From d1592b9d92d8e47dbcd0c7db014d119c3793a7dd Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 28 Jul 2021 01:18:37 +0800 Subject: [PATCH] stripping: add libnss_*.so* into online_usrlib Glibc loads these "NSS modules" (see man 5 nss) on startup. This is implemented with something like dlopen() so "ldd" won't show them up. So they should be considered "online" here. Without this addition, overwriting libnss_files-2.33.so reproducibly triggers a crash during jhalfs runs where stripping is enabled. In manual builds, it reproducibly triggers a crash exiting from chroot. After this change I reran stripping 5 times and there was no crash observed. --- chapter01/changelog.xml | 10 ++++++++++ chapter08/strippingagain.xml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 1b17760f2..ab4b04b7e 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,16 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2021-07-27 + + + [xry111] - Use workaround for Glibc NSS modules during + stripping, to prevent bash from crash. + + + + 2021-07-26 diff --git a/chapter08/strippingagain.xml b/chapter08/strippingagain.xml index e663f2d8e..196698f2a 100644 --- a/chapter08/strippingagain.xml +++ b/chapter08/strippingagain.xml @@ -62,7 +62,8 @@ online_usrbin="bash find strip" online_usrlib="libbfd-&binutils-version;.so libdl-&glibc-version;.so libhistory.so.&readline-version; libncursesw.so.&ncurses-version; libm-&glibc-version;.so libreadline.so.&readline-version; - libz.so.&zlib-version;" + libz.so.&zlib-version; + $(cd /usr/lib; find libnss*.so* -type f)" for BIN in $online_usrbin; do cp /usr/bin/$BIN /tmp/$BIN