From d282f88dea360aad595acec9b794618890cdb1eb Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 19 Jan 2024 12:47:33 +0800 Subject: [PATCH 1/8] ncurses: Modify the header to always use the ABI of ncursesw instead of the 8-bit ncurses. We don't provide the 8-bit ncurses library and we are "faking" it using ncursesw. Thus innocent package may be compiled with the 8-bit ABI (because it does not know what we are doing and so it does not use the "expected" preprocessor definitions to enable the wide ABI) but linked against ncursesw, causing a potential ABI mismatch. --- chapter01/changelog.xml | 12 ++++++++++++ chapter06/ncurses.xml | 21 ++++++++++++++++++++- chapter08/ncurses.xml | 7 ++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 301e3dff1..4865c68ab 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,18 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2024-01-18 + + + [xry111] - Edit a ncurses header to always use the + wide-character ABI compatible with libncursesw.so because we + are faking the 8-bit libncurses.so with it. Fixes + #5415. + + + + 2024-01-09 diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index f25c43777..f491c2c92 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -156,7 +156,9 @@ popd Install the package: make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install -echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so +echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so +sed -e 's/^#if.*XOPEN.*$/#if 1/' \ + -i $LFS/usr/include/curses.h + + 2024-01-21 + + + [xry111] - Fix CVE-2024-0684 for coreutils-9.4. Fixes + #5417. + + + + 2024-01-18 diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml index 87833a134..e6114461f 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -53,13 +53,13 @@ those bugs are reproducible without this patch. - - + Fix a security vulnerability in the split + utility: + +sed -e '/n_out += n_hold/,+4 s|.*bufsize.*|//&|' \ + -i src/split.c -sed '/if ( ! match/s/ed_checksums//' -i src/digest.c ---> Now prepare Coreutils for compilation: autoreconf -fiv From 3baf03a954ed3e4e468e5c88ebe1b7e2ca5f0132 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 22 Jan 2024 01:03:33 +0800 Subject: [PATCH 4/8] Package updates: - Update to jinja2-3.1.3 (#5411) - Update to bc-6.7.5 (#5408) - Update to attr-2.5.2 (#5412) - Update to ncurses-6.4-20230520 (#5416) - Update to markupsafe-2.1.4 (#5418) - Update to linux-6.7.1 (#5406) - Update to iproute2-6.7.0 (#5410) - Update to vim-9.1.0041 (#4500) - Update to iana-etc-20240117 (#5006) - Update to shadow-4.14.3 (#5413) --- chapter01/changelog.xml | 40 ++++++++++++++++++++++++ chapter01/whatsnew.xml | 16 +++++----- chapter08/ncurses.xml | 10 +++--- packages.ent | 69 +++++++++++++++++++++-------------------- 4 files changed, 89 insertions(+), 46 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 862f90455..3f2ae8e29 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,46 @@ 2024-01-21 + + [xry111] - Update to jinja2-3.1.3 (security fix). Fixes + #5411. + + + [xry111] - Update to bc-6.7.5. Fixes + #5408. + + + [xry111] - Update to attr-2.5.2. Fixes + #5412. + + + [xry111] - Update to ncurses-6.4-20230520 (security fix). + Fixes #5416. + + + [xry111] - Update to markupsafe-2.1.4. Fixes + #5418. + + + [xry111] - Update to linux-6.7.1. Fixes + #5406. + + + [xry111] - Update to iproute2-6.7.0. Fixes + #5410. + + + [xry111] - Update to vim-9.1.0041. Addresses + #4500. + + + [xry111] - Update to iana-etc-20240117. Addresses + #5006. + + + [xry111] - Update to shadow-4.14.3. Fixes + #5413. + [xry111] - Fix CVE-2024-0684 for coreutils-9.4. Fixes #5417. diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index e0c77ed72..918bc0f0b 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -29,9 +29,9 @@ - + Autoconf-&autoconf-version; @@ -134,9 +134,9 @@ IPRoute2-&iproute2-version; - + Kbd-&kbd-version; @@ -179,9 +179,9 @@ - + Meson-&meson-version; @@ -191,9 +191,9 @@ MPFR-&mpfr-version; - + diff --git a/chapter08/ncurses.xml b/chapter08/ncurses.xml index 14113d7e3..83ce508d6 100644 --- a/chapter08/ncurses.xml +++ b/chapter08/ncurses.xml @@ -99,9 +99,9 @@ --enable-widec This switch causes wide-character libraries (e.g., libncursesw.so.&ncurses-version;) + class="libraryfile">libncursesw.so.&ncurses-release;) to be built instead of normal ones (e.g., libncurses.so.&ncurses-version;). + class="libraryfile">libncurses.so.&ncurses-release;). These wide-character libraries are usable in both multibyte and traditional 8-bit locales, while normal libraries work properly only in 8-bit locales. Wide-character and normal libraries are @@ -127,7 +127,7 @@ make will spawn new shell processes during "make install". --> The installation of this package will overwrite - libncursesw.so.&ncurses-version; + libncursesw.so.&ncurses-release; in-place. It may crash the shell process which is using code and data from the library file. Install the package with DESTDIR, and replace the library file correctly using @@ -137,8 +137,8 @@ ): make DESTDIR=$PWD/dest install -install -vm755 dest/usr/lib/libncursesw.so.&ncurses-version; /usr/lib -rm -v dest/usr/lib/libncursesw.so.&ncurses-version; +install -vm755 dest/usr/lib/libncursesw.so.&ncurses-release; /usr/lib +rm -v dest/usr/lib/libncursesw.so.&ncurses-release; sed -e 's/^#if.*XOPEN.*$/#if 1/' \ -i dest/usr/include/curses.h cp -av dest/* / diff --git a/packages.ent b/packages.ent index b1cc7c1d5..fba1f5405 100644 --- a/packages.ent +++ b/packages.ent @@ -21,10 +21,10 @@ - - + + - + @@ -57,10 +57,10 @@ - - + + - + @@ -317,10 +317,10 @@ - - + + - + @@ -341,18 +341,18 @@ - - + + - + - - + + - + @@ -430,13 +430,13 @@ - - + + - + - + + + + @@ -636,10 +639,10 @@ - - + + - + @@ -735,13 +738,13 @@ - + - - + + - + From 75d26160ceac72d6b08c6ed11bebf657da353c70 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 22 Jan 2024 01:19:31 +0800 Subject: [PATCH 5/8] pkgconf: Update the fix for modversion regression (#5414) --- chapter01/changelog.xml | 4 ++++ chapter01/whatsnew.xml | 4 ++++ chapter03/patches.xml | 9 ++++----- chapter08/pkgconf.xml | 4 ++-- patches.ent | 4 ++++ 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 3f2ae8e29..aba69a0de 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -43,6 +43,10 @@ 2024-01-21 + + [xry111] - Apply upstream fix for pkgconf-2.1.0 regression. + Fixes #5414. + [xry111] - Update to jinja2-3.1.3 (security fix). Fixes #5411. diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml index 918bc0f0b..2dd0a8d02 100644 --- a/chapter01/whatsnew.xml +++ b/chapter01/whatsnew.xml @@ -298,6 +298,10 @@ &glibc-upstream-fixes-patch; + + &pkgconf-upstream-fix-patch; + + &readline-fixes-patch; diff --git a/chapter03/patches.xml b/chapter03/patches.xml index 263f3ec1b..50ff56a6f 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -117,15 +117,14 @@ --> - Readline Upstream Fix Patch - &readline-fixes-patch-size;: diff --git a/chapter08/pkgconf.xml b/chapter08/pkgconf.xml index 0155356aa..139e0c810 100644 --- a/chapter08/pkgconf.xml +++ b/chapter08/pkgconf.xml @@ -45,9 +45,9 @@ Installation of Pkgconf - Fix a regression in pkgconf-2.0.3 breaking BLFS packages: + Fix a regression in pkgconf-2.1.0 breaking BLFS packages: - sed -i 's/str\(cmp.*package\)/strn\1, strlen(pkg->why)/' cli/main.c + patch -Np1 -i ../&pkgconf-upstream-fix-patch; Prepare Pkgconf for compilation: diff --git a/patches.ent b/patches.ent index 1bcd45dc3..d27c717de 100644 --- a/patches.ent +++ b/patches.ent @@ -22,6 +22,10 @@ + + + + From 24d03240bf2406c189ce98b69cc1678ce78e5d10 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 22 Jan 2024 01:28:02 +0800 Subject: [PATCH 6/8] kernel: Regenerate kernel config with 6.7.1 No content change! --- chapter10/kernel/kernel.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter10/kernel/kernel.version b/chapter10/kernel/kernel.version index e411592c2..06a765991 100644 --- a/chapter10/kernel/kernel.version +++ b/chapter10/kernel/kernel.version @@ -1 +1 @@ -6.6.3 +6.7.1 From 46b5c6b63bbf30b84b37be75a0f494c85be66d09 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 22 Jan 2024 01:32:56 +0800 Subject: [PATCH 7/8] gcc: Fix libcc1 description libcpp is the preprocessor library, but it's a static library which is only used by GCC itself and not installed. libcc1 is actually a library for GDB to "compile" expressions, so we can use fancy expressions in commands, like "print sin(x + 2.0)": the expression sin(x + 2.0) needs to be "compiled" for evaluation. --- chapter08/gcc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 349d83c2a..7f21cf853 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -534,7 +534,7 @@ mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib libcc1 - The C preprocessing library + A library that allows GDB to make use of GCC libcc1 From 47bc996103ea5b9e5f29d582826aeb469554ecdc Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 22 Jan 2024 02:20:43 +0800 Subject: [PATCH 8/8] Makefile: Ensure wget-list and md5sums regenerated when patches.xml or packages.xml has changed --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c45a56943..1f1de8d23 100644 --- a/Makefile +++ b/Makefile @@ -150,9 +150,11 @@ profile-html: stylesheets/lfs-xsl/profile.xsl \ $(RENDERTMP)/lfs-full.xml +DOWNLOADS_DEP = chapter03/packages.xml chapter03/patches.xml \ + packages.ent patches.ent general.ent + wget-list: $(BASEDIR)/wget-list $(BASEDIR)/wget-list-$(REV) -$(BASEDIR)/wget-list: stylesheets/wget-list.xsl chapter03/chapter03.xml \ - packages.ent patches.ent general.ent +$(BASEDIR)/wget-list: stylesheets/wget-list.xsl $(DOWNLOADS_DEP) @echo "Generating consolidated wget list at $(BASEDIR)/wget-list ..." $(Q)mkdir -p $(BASEDIR) $(Q)xsltproc --xinclude --nonet \ @@ -160,9 +162,7 @@ $(BASEDIR)/wget-list: stylesheets/wget-list.xsl chapter03/chapter03.xml \ stylesheets/wget-list.xsl \ chapter03/chapter03.xml -$(BASEDIR)/wget-list-$(REV): stylesheets/wget-list.xsl \ - chapter03/chapter03.xml \ - packages.ent patches.ent general.ent +$(BASEDIR)/wget-list-$(REV): stylesheets/wget-list.xsl $(DOWNLOADS_DEP) $(Q)xsltproc --nonet --xinclude \ --stringparam profile.revision $(REV) \ --output $(RENDERTMP)/wget-list.xml \ @@ -174,8 +174,7 @@ $(BASEDIR)/wget-list-$(REV): stylesheets/wget-list.xsl \ $(RENDERTMP)/wget-list.xml md5sums: $(BASEDIR)/md5sums -$(BASEDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml \ - packages.ent patches.ent +$(BASEDIR)/md5sums: stylesheets/wget-list.xsl $(DOWNLOADS_DEP) @echo "Generating consolidated md5sum file at $(BASEDIR)/md5sums ..." $(Q)mkdir -p $(BASEDIR)