diff options
author | Xi Ruoyao <xry111@mengyan1223.wang> | 2021-07-28 01:18:37 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@mengyan1223.wang> | 2021-07-28 01:27:33 +0800 |
commit | d1592b9d92d8e47dbcd0c7db014d119c3793a7dd (patch) | |
tree | ac1392cc175bc0a35ea47418525d8f821b69523b | |
parent | 5287d521e911ff762ec8b4445cecfbacb042e6c8 (diff) |
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.
-rw-r--r-- | chapter01/changelog.xml | 10 | ||||
-rw-r--r-- | chapter08/strippingagain.xml | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 1b17760f2..ab4b04b7e 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -44,6 +44,16 @@ --> <listitem> + <para>2021-07-27</para> + <itemizedlist> + <listitem> + <para>[xry111] - Use workaround for Glibc NSS modules during + stripping, to prevent bash from crash.</para> + </listitem> + </itemizedlist> + </listitem> + + <listitem> <para>2021-07-26</para> <itemizedlist> <listitem> 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 |