CRUX
Threads by month
- ----- 2024 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
September 2021
- 14 participants
- 38 discussions
xinit fails with xorg-server 1.20.13-3: the symling X->Xorg is missing.
Besides that the new Xorg has no sticky bit set.
Thanks,
Xavier
1
0
ports/compat-32 (3.6): [notify] mesa-32: enables wayland platform optionally
by crux@crux.nu 19 Sep '21
by crux@crux.nu 19 Sep '21
19 Sep '21
commit 1eb56fdd31609df532de8b77769715742428499f
Author: Tim Biermann <tbier(a)posteo.de>
Date: Sun Sep 19 19:57:09 2021 +0200
[notify] mesa-32: enables wayland platform optionally
diff --git a/mesa-32/.signature b/mesa-32/.signature
index 4ecc192..b241bae 100644
--- a/mesa-32/.signature
+++ b/mesa-32/.signature
@@ -1,6 +1,6 @@
untrusted comment: verify with /etc/ports/compat-32.pub
-RWSwxGo/zH7eXXjAm9Lx4Apqbo/8WED9T5wCm5s7yU4ZLYVEiSI+mr+0ORz6Wn2B23DQS/J5VJ8FBouyJqa3dw+UJ/8LLvHkhQE=
-SHA256 (Pkgfile) = 63812cc4e47335310120c2dd78ad113127cdac7ff7cc5196f0039d802025d3c3
+RWSwxGo/zH7eXVuhZ3kD3rphvOV+wl5jHi+5jvqLH2h4HxPpknuGfwGj1TzCVBKetx5JpphebzRw41ZH7hQM3ocwj4LqLcKAMQE=
+SHA256 (Pkgfile) = 50eac6a638ea8fd049ea278ddd9098f446aa9c527108eaf621058ba8535c2dcd
SHA256 (.footprint) = 780b1525e8bf8a789c2aa204c5970636473be4cc1a6eb1925996af6df2842b84
SHA256 (mesa-21.2.1.tar.xz) = 2c65e6710b419b67456a48beefd0be827b32db416772e0e363d5f7d54dc01787
SHA256 (x86-linux-gnu) = 448877bbe3efe8bdfe6282c8e730fe8a8b6bf3c07f659e71b7292aceca22d8bd
diff --git a/mesa-32/Pkgfile b/mesa-32/Pkgfile
index a341f23..c2a2d2d 100644
--- a/mesa-32/Pkgfile
+++ b/mesa-32/Pkgfile
@@ -2,6 +2,7 @@
# URL: https://www.mesa3d.org/
# Maintainer: CRUX compat-32 Team, compat-32-ports at crux dot nu
# Depends on: elfutils-32 expat-32 libdrm-32 libglvnd-32 libvdpau-32 llvm-32 mesa xorg-libxdamage-32 xorg-libxrandr-32 xorg-libxshmfence-32 xorg-libxvmc-32 xorg-libxxf86vm-32 zstd-32
+# Optional: glslang-32 wayland-32 wayland-protocols
name=mesa-32
version=21.2.1
@@ -10,24 +11,32 @@ source=(https://archive.mesa3d.org/mesa-$version.tar.xz
x86-linux-gnu)
build() {
- meson setup build mesa-$version \
+ prt-get isinst wayland-32 wayland-protocols && PKGMK_MESA_PLATFORMS+=',wayland'
+ prt-get isinst glslang-32 && PKGMK_MESA_PLATFORMS+=' -D vulkan-overlay-layer=true -D vulkan-device-select-layer=true'
+
+ meson setup mesa-$version build $PKGMK_MESA3D \
--cross-file=$SRC/x86-linux-gnu \
--prefix=/usr \
--libdir=/usr/lib32 \
--sysconfdir=/etc \
--buildtype=plain \
+ --wrap-mode nodownload \
+ -D b_lto=true \
+ -D b_pie=true \
-D llvm=enabled \
-D shared-llvm=enabled \
-D gbm=enabled \
- -D gles1=enabled \
+ -D gles1=disabled \
-D gles2=enabled \
-D osmesa=true \
+ -D platforms=x11$PKGMK_MESA_PLATFORMS \
-D gallium-xa=enabled \
-D gallium-vdpau=enabled \
- -D platforms=x11 \
-D gallium-drivers=r300,r600,svga,swrast,radeonsi,nouveau,iris,virgl \
-D vulkan-drivers=amd,intel \
- -D glvnd=true
+ -D glvnd=true \
+ -D dri3=enabled \
+ -D egl=enabled
meson compile -C build -j ${JOBS:-1}
DESTDIR=$PKG meson install -C build
1
0
ports/xorg (3.6): [notify] xorg-server: build system changed to meson/ninja, new depedency nettle, check revdep after update
by crux@crux.nu 19 Sep '21
by crux@crux.nu 19 Sep '21
19 Sep '21
commit 8b5737b6438f5fba4871da649d1988b144ea526d
Author: Tim Biermann <tbier(a)posteo.de>
Date: Sun Sep 19 20:19:30 2021 +0200
[notify] xorg-server: build system changed to meson/ninja, new depedency nettle, check revdep after update
diff --git a/xorg-server/.footprint b/xorg-server/.footprint
index fffdf7f8..b1c0248c 100644
--- a/xorg-server/.footprint
+++ b/xorg-server/.footprint
@@ -3,9 +3,8 @@ drwxr-xr-x root/root etc/X11/
drwxr-xr-x root/root etc/X11/xorg.conf.d/
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-lrwxrwxrwx root/root usr/bin/X -> Xorg
-rwxr-xr-x root/root usr/bin/Xnest
--rwsr-xr-x root/root usr/bin/Xorg
+-rwxr-xr-x root/root usr/bin/Xorg
-rwxr-xr-x root/root usr/bin/Xvfb
-rwxr-xr-x root/root usr/bin/cvt
-rwxr-xr-x root/root usr/bin/gtf
@@ -175,33 +174,24 @@ drwxr-xr-x root/root usr/include/xorg/
drwxr-xr-x root/root usr/lib/
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/xorg-server.pc
+drwxr-xr-x root/root usr/lib/xorg-server/
+-rwxr-xr-x root/root usr/lib/xorg-server/Xorg
+-rwsr-xr-x root/root usr/lib/xorg-server/Xorg.wrap
drwxr-xr-x root/root usr/lib/xorg/
drwxr-xr-x root/root usr/lib/xorg/modules/
drwxr-xr-x root/root usr/lib/xorg/modules/drivers/
--rwxr-xr-x root/root usr/lib/xorg/modules/drivers/modesetting_drv.la
-rwxr-xr-x root/root usr/lib/xorg/modules/drivers/modesetting_drv.so
drwxr-xr-x root/root usr/lib/xorg/modules/extensions/
--rwxr-xr-x root/root usr/lib/xorg/modules/extensions/libglx.la
-rwxr-xr-x root/root usr/lib/xorg/modules/extensions/libglx.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libexa.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libexa.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libfb.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libfb.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libfbdevhw.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libfbdevhw.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libglamoregl.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libglamoregl.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libint10.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libint10.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libshadow.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libshadow.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libshadowfb.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libshadowfb.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libvbe.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libvbe.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libvgahw.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libvgahw.so
--rwxr-xr-x root/root usr/lib/xorg/modules/libwfb.la
-rwxr-xr-x root/root usr/lib/xorg/modules/libwfb.so
-rw-r--r-- root/root usr/lib/xorg/protocol.txt
drwxr-xr-x root/root usr/share/
@@ -214,6 +204,7 @@ drwxr-xr-x root/root usr/share/man/
drwxr-xr-x root/root usr/share/man/man1/
-rw-r--r-- root/root usr/share/man/man1/Xnest.1.gz
-rw-r--r-- root/root usr/share/man/man1/Xorg.1.gz
+-rw-r--r-- root/root usr/share/man/man1/Xorg.wrap.1.gz
-rw-r--r-- root/root usr/share/man/man1/Xserver.1.gz
-rw-r--r-- root/root usr/share/man/man1/Xvfb.1.gz
-rw-r--r-- root/root usr/share/man/man1/cvt.1.gz
@@ -223,9 +214,6 @@ drwxr-xr-x root/root usr/share/man/man4/
-rw-r--r-- root/root usr/share/man/man4/fbdevhw.4.gz
-rw-r--r-- root/root usr/share/man/man4/modesetting.4.gz
drwxr-xr-x root/root usr/share/man/man5/
+-rw-r--r-- root/root usr/share/man/man5/Xwrapper.config.5.gz
-rw-r--r-- root/root usr/share/man/man5/xorg.conf.5.gz
-rw-r--r-- root/root usr/share/man/man5/xorg.conf.d.5.gz
-drwxr-xr-x root/root var/
-drwxr-xr-x root/root var/lib/
-drwxr-xr-x root/root var/lib/xkb/
--rw-r--r-- root/root var/lib/xkb/README.compiled
diff --git a/xorg-server/.signature b/xorg-server/.signature
index edfaa1ed..e7bff616 100644
--- a/xorg-server/.signature
+++ b/xorg-server/.signature
@@ -1,5 +1,7 @@
untrusted comment: verify with /etc/ports/xorg.pub
-RWTSGWF5Q7TndJ8NqnSumNK4m6mlbqZQCmmsURA9Uh1B7UAssNlR3EcpzfLR1VCff+PY/adoxugmzGiYjYmv6V5WS4vYjydyFw8=
-SHA256 (Pkgfile) = 37e19a73f6cb44812b92d64bd42086ee791202d0670f0931558a96bde73b2c27
-SHA256 (.footprint) = d159a275a4868001332954580ab4f70976c97a80334b157023935b36722e50cd
+RWTSGWF5Q7TndEoK0L1fFjTMw5A7u0JA3TZLHVnXlipQmXhkoHynUQpEdCHkiryINOU1+WqosQPnTv3qKzNjrCW9MQRUuLk1dQ0=
+SHA256 (Pkgfile) = dd85837f7c8fc4c0a431080b9577826c6bd5f06903c528e336bf2503352ac339
+SHA256 (.footprint) = 22ebe7390e74b30e28ca4833bba98490684c8b6258af9ee17d5940a114732333
SHA256 (xorg-server-1.20.13.tar.xz) = 40aa4e96a56a81a301f15a9b10e06a22700f12b42d9e0e453c7f11d354386300
+SHA256 (0001-v2-FS-58644.patch) = 6253fb5cf06cf650539be585d6ca13cfa00217b51ca9825476c8fd55c09341a4
+SHA256 (xserver-autobind-hotplug.patch) = cae1b7f296c18177de38f9b1215a4f916da2288b85f1fcb9e80373a42e2892b8
diff --git a/xorg-server/0001-v2-FS-58644.patch b/xorg-server/0001-v2-FS-58644.patch
new file mode 100644
index 00000000..bb2e463e
--- /dev/null
+++ b/xorg-server/0001-v2-FS-58644.patch
@@ -0,0 +1,57 @@
+From 17584285d296acaa80f131ca0e8b75eff675962b Mon Sep 17 00:00:00 2001
+From: fafryd <dz1125.bug.tracker(a)gmail.com>
+Date: Sun, 20 May 2018 14:30:43 +0200
+Subject: [PATCH] v2 FS#58644
+
+---
+ hw/xfree86/common/meson.build | 13 +++++++++++++
+ hw/xfree86/meson.build | 12 +++++++-----
+ 2 files changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/hw/xfree86/common/meson.build b/hw/xfree86/common/meson.build
+index 514999ff6..0eff6e488 100644
+--- a/hw/xfree86/common/meson.build
++++ b/hw/xfree86/common/meson.build
+@@ -1,3 +1,16 @@
++if get_option('suid_wrapper')
++ x_sh = configure_file(
++ input: '../Xorg.sh.in',
++ output: 'Xorg',
++ configuration: conf_data,
++ )
++ install_data(
++ x_sh,
++ install_mode: 'rwxr-xr-x',
++ install_dir: join_paths(get_option('prefix'), get_option('bindir')),
++ )
++endif
++
+ srcs_xorg_common = [
+ 'xf86fbBus.c',
+ 'xf86noBus.c',
+diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build
+index cacf56d4c..d1295d404 100644
+--- a/hw/xfree86/meson.build
++++ b/hw/xfree86/meson.build
+@@ -145,11 +145,13 @@ if get_option('suid_wrapper')
+ install_dir: get_option('libexecdir'),
+ # install_mode: ['r-sr-xr-x', 0, 0],
+ )
+- configure_file(
+- input: 'Xorg.sh.in',
+- output: 'Xorg',
+- configuration: conf_data,
+- install_dir: join_paths(get_option('prefix'), get_option('bindir')),
++ meson.add_install_script(
++ 'sh', '-c',
++ 'chmod u+s @0@@1@/@2@'.format(
++ '${DESTDIR}',
++ join_paths(get_option('prefix'), get_option('libexecdir')),
++ 'Xorg.wrap'
++ )
+ )
+ endif
+
+--
+2.17.0
+
diff --git a/xorg-server/Pkgfile b/xorg-server/Pkgfile
index c9d9c4e0..d9620a13 100644
--- a/xorg-server/Pkgfile
+++ b/xorg-server/Pkgfile
@@ -1,30 +1,34 @@
# Description: X Window System server
# URL: http://xorg.freedesktop.org
# Maintainer: CRUX Xorg Team, xorg-ports at crux dot nu
-# Depends on: libepoxy xorg-bdftopcf xorg-font-util xorg-libdmx xorg-libxaw xorg-libxcomposite xorg-libxcursor xorg-libxfont2 xorg-libxft xorg-libxinerama xorg-libxkbfile xorg-libxres xorg-libxtst xorg-libxxf86dga xorg-mkfontscale xorg-xcb-util-keysyms
+# Depends on: libepoxy nettle xorg-bdftopcf xorg-font-util xorg-libdmx xorg-libxaw xorg-libxcomposite xorg-libxcursor xorg-libxfont2 xorg-libxft xorg-libxinerama xorg-libxres xorg-libxtst xorg-libxxf86dga xorg-mkfontscale xorg-xcb-util-keysyms xorg-xkbcomp
name=xorg-server
version=1.20.13
-release=1
-source=(https://www.x.org/releases/individual/xserver/$name-$version.tar.xz)
+release=2
+source=(https://www.x.org/releases/individual/xserver/$name-$version.tar.xz
+ 0001-v2-FS-58644.patch xserver-autobind-hotplug.patch)
build() {
- cd $name-$version
+ # https://bugs.freedesktop.org/show_bug.cgi?id=106588
+ patch -Np1 -d $SRC/$name-$version -i $SRC/0001-v2-FS-58644.patch
+ patch -Np1 -d $SRC/$name-$version -i $SRC/xserver-autobind-hotplug.patch
- ./configure \
+ meson setup $name-$version build \
--prefix=/usr \
+ --libexecdir=/usr/lib/$name \
--localstatedir=/var \
- --with-fontrootdir=/usr/share/fonts/X11 \
- --with-xkb-output=/var/lib/xkb \
- --enable-dri \
- --with-sha1=libcrypto \
- --disable-systemd-logind \
- --enable-glamor
-
- make
- make DESTDIR=$PKG install
-
- rmdir $PKG/var/log
+ --buildtype=plain \
+ --wrap-mode nodownload \
+ -D b_lto=true \
+ -D b_pie=true \
+ -D os_vendor="CRUX" \
+ -D xkb_dir=/usr/share/X11/xkb \
+ -D xkb_output_dir=/var/lib/xkb \
+ -D suid_wrapper=true \
+ -D xorg=true
+ meson compile -C build
+ DESTDIR=$PKG meson install -C build
install -m 755 -d $PKG/etc/X11/xorg.conf.d
}
diff --git a/xorg-server/xserver-autobind-hotplug.patch b/xorg-server/xserver-autobind-hotplug.patch
new file mode 100644
index 00000000..86b96a23
--- /dev/null
+++ b/xorg-server/xserver-autobind-hotplug.patch
@@ -0,0 +1,293 @@
+From 471289fa1dc359555ceed6302f7d9605ab6be3ea Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied(a)redhat.com>
+Date: Mon, 2 Apr 2018 16:49:02 -0400
+Subject: [PATCH] autobind GPUs to the screen
+
+This is a modified version of a patch we've been carry-ing in Fedora and
+RHEL for years now. This patch automatically adds secondary GPUs to the
+master as output sink / offload source making e.g. the use of
+slave-outputs just work, with requiring the user to manually run
+"xrandr --setprovideroutputsource" before he can hookup an external
+monitor to his hybrid graphics laptop.
+
+There is one problem with this patch, which is why it was not upstreamed
+before. What to do when a secondary GPU gets detected really is a policy
+decission (e.g. one may want to autobind PCI GPUs but not USB ones) and
+as such should be under control of the Desktop Environment.
+
+Unconditionally adding autobinding support to the xserver will result
+in races between the DE dealing with the hotplug of a secondary GPU
+and the server itself dealing with it.
+
+However we've waited for years for any Desktop Environments to actually
+start doing some sort of autoconfiguration of secondary GPUs and there
+is still not a single DE dealing with this, so I believe that it is
+time to upstream this now.
+
+To avoid potential future problems if any DEs get support for doing
+secondary GPU configuration themselves, the new autobind functionality
+is made optional. Since no DEs currently support doing this themselves it
+is enabled by default. When DEs grow support for doing this themselves
+they can disable the servers autobinding through the servers cmdline or a
+xorg.conf snippet.
+
+Signed-off-by: Dave Airlie <airlied(a)gmail.com>
+[hdegoede(a)redhat.com: Make configurable, fix with nvidia, submit upstream]
+Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
+---
+ hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++
+ hw/xfree86/common/xf86Globals.c | 2 ++
+ hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++
+ hw/xfree86/common/xf86Priv.h | 1 +
+ hw/xfree86/common/xf86Privstr.h | 1 +
+ hw/xfree86/common/xf86platformBus.c | 4 ++++
+ hw/xfree86/man/Xorg.man | 7 +++++++
+ hw/xfree86/man/xorg.conf.man | 6 ++++++
+ randr/randrstr.h | 3 +++
+ randr/rrprovider.c | 22 ++++++++++++++++++++++
+ 10 files changed, 85 insertions(+)
+
+diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
+index 2c1d335..d7d7c2e 100644
+--- a/hw/xfree86/common/xf86Config.c
++++ b/hw/xfree86/common/xf86Config.c
+@@ -643,6 +643,7 @@ typedef enum {
+ FLAG_DRI2,
+ FLAG_USE_SIGIO,
+ FLAG_AUTO_ADD_GPU,
++ FLAG_AUTO_BIND_GPU,
+ FLAG_MAX_CLIENTS,
+ FLAG_IGLX,
+ FLAG_DEBUG,
+@@ -699,6 +700,8 @@ static OptionInfoRec FlagOptions[] = {
+ {0}, FALSE},
+ {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN,
+ {0}, FALSE},
++ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN,
++ {0}, FALSE},
+ {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER,
+ {0}, FALSE },
+ {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN,
+@@ -779,6 +782,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
+ }
+ xf86Msg(from, "%sutomatically adding GPU devices\n",
+ xf86Info.autoAddGPU ? "A" : "Not a");
++
++ if (xf86AutoBindGPUDisabled) {
++ xf86Info.autoBindGPU = FALSE;
++ from = X_CMDLINE;
++ }
++ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) {
++ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU,
++ &xf86Info.autoBindGPU);
++ from = X_CONFIG;
++ }
++ else {
++ from = X_DEFAULT;
++ }
++ xf86Msg(from, "%sutomatically binding GPU devices\n",
++ xf86Info.autoBindGPU ? "A" : "Not a");
++
+ /*
+ * Set things up based on the config file information. Some of these
+ * settings may be overridden later when the command line options are
+diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
+index e890f05..7b27b4c 100644
+--- a/hw/xfree86/common/xf86Globals.c
++++ b/hw/xfree86/common/xf86Globals.c
+@@ -131,6 +131,7 @@ xf86InfoRec xf86Info = {
+ #else
+ .autoAddGPU = FALSE,
+ #endif
++ .autoBindGPU = TRUE,
+ };
+
+ const char *xf86ConfigFile = NULL;
+@@ -191,6 +192,7 @@ Bool xf86FlipPixels = FALSE;
+ Gamma xf86Gamma = { 0.0, 0.0, 0.0 };
+
+ Bool xf86AllowMouseOpenFail = FALSE;
++Bool xf86AutoBindGPUDisabled = FALSE;
+
+ #ifdef XF86VIDMODE
+ Bool xf86VidModeDisabled = FALSE;
+diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
+index ea42ec9..ec255b6 100644
+--- a/hw/xfree86/common/xf86Init.c
++++ b/hw/xfree86/common/xf86Init.c
+@@ -76,6 +76,7 @@
+ #include "xf86DDC.h"
+ #include "xf86Xinput.h"
+ #include "xf86InPriv.h"
++#include "xf86Crtc.h"
+ #include "picturestr.h"
+ #include "randrstr.h"
+ #include "glxvndabi.h"
+@@ -237,6 +238,19 @@ xf86PrivsElevated(void)
+ return PrivsElevated();
+ }
+
++static void
++xf86AutoConfigOutputDevices(void)
++{
++ int i;
++
++ if (!xf86Info.autoBindGPU)
++ return;
++
++ for (i = 0; i < xf86NumGPUScreens; i++)
++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]),
++ xf86ScrnToScreen(xf86Screens[0]));
++}
++
+ static void
+ TrapSignals(void)
+ {
+@@ -770,6 +784,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
+ for (i = 0; i < xf86NumGPUScreens; i++)
+ AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+
++ xf86AutoConfigOutputDevices();
++
+ xf86VGAarbiterWrapFunctions();
+ if (sigio_blocked)
+ input_unlock();
+@@ -1278,6 +1294,10 @@ ddxProcessArgument(int argc, char **argv, int i)
+ xf86Info.iglxFrom = X_CMDLINE;
+ return 0;
+ }
++ if (!strcmp(argv[i], "-noautoBindGPU")) {
++ xf86AutoBindGPUDisabled = TRUE;
++ return 1;
++ }
+
+ /* OS-specific processing */
+ return xf86ProcessArgument(argc, argv, i);
+diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
+index 4fe2b5f..6566622 100644
+--- a/hw/xfree86/common/xf86Priv.h
++++ b/hw/xfree86/common/xf86Priv.h
+@@ -46,6 +46,7 @@
+ extern _X_EXPORT const char *xf86ConfigFile;
+ extern _X_EXPORT const char *xf86ConfigDir;
+ extern _X_EXPORT Bool xf86AllowMouseOpenFail;
++extern _X_EXPORT Bool xf86AutoBindGPUDisabled;
+
+ #ifdef XF86VIDMODE
+ extern _X_EXPORT Bool xf86VidModeDisabled;
+diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
+index 21c2e1f..6c71863 100644
+--- a/hw/xfree86/common/xf86Privstr.h
++++ b/hw/xfree86/common/xf86Privstr.h
+@@ -98,6 +98,7 @@ typedef struct {
+
+ Bool autoAddGPU;
+ const char *debug;
++ Bool autoBindGPU;
+ } xf86InfoRec, *xf86InfoPtr;
+
+ /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
+diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
+index cef47da..913a324 100644
+--- a/hw/xfree86/common/xf86platformBus.c
++++ b/hw/xfree86/common/xf86platformBus.c
+@@ -49,6 +49,7 @@
+ #include "Pci.h"
+ #include "xf86platformBus.h"
+ #include "xf86Config.h"
++#include "xf86Crtc.h"
+
+ #include "randrstr.h"
+ int platformSlotClaimed;
+@@ -665,6 +666,9 @@ xf86platformAddDevice(int index)
+ }
+ /* attach unbound to 0 protocol screen */
+ AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
++ if (xf86Info.autoBindGPU)
++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]),
++ xf86ScrnToScreen(xf86Screens[0]));
+
+ RRResourcesChanged(xf86Screens[0]->pScreen);
+ RRTellChanged(xf86Screens[0]->pScreen);
+diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man
+index 13a9dc3..745f986 100644
+--- a/hw/xfree86/man/Xorg.man
++++ b/hw/xfree86/man/Xorg.man
+@@ -283,6 +283,13 @@ is a comma separated list of directories to search for
+ server modules. This option is only available when the server is run
+ as root (i.e, with real-uid 0).
+ .TP 8
++.B \-noautoBindGPU
++Disable automatically setting secondary GPUs up as output sinks and offload
++sources. This is equivalent to setting the
++.B AutoBindGPU
++xorg.conf(__filemansuffix__) file option. To
++.B false.
++.TP 8
+ .B \-nosilk
+ Disable Silken Mouse support.
+ .TP 8
+diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
+index 9589262..8d51e06 100644
+--- a/hw/xfree86/man/xorg.conf.man
++++ b/hw/xfree86/man/xorg.conf.man
+@@ -672,6 +672,12 @@ Enabled by default.
+ If this option is disabled, then no GPU devices will be added from the udev
+ backend. Enabled by default. (May need to be disabled to setup Xinerama).
+ .TP 7
++.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q
++If enabled then secondary GPUs will be automatically set up as output-sinks and
++offload-sources. Making e.g. laptop outputs connected only to the secondary
++GPU directly available for use without needing to run
++"xrandr --setprovideroutputsource". Enabled by default.
++.TP 7
+ .BI "Option \*qLog\*q \*q" string \*q
+ This option controls whether the log is flushed and/or synced to disk after
+ each message.
+diff --git a/randr/randrstr.h b/randr/randrstr.h
+index f94174b..092d726 100644
+--- a/randr/randrstr.h
++++ b/randr/randrstr.h
+@@ -1039,6 +1039,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p);
+ extern _X_EXPORT void
+ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider);
+
++extern _X_EXPORT void
++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen);
++
+ /* rrproviderproperty.c */
+
+ extern _X_EXPORT void
+diff --git a/randr/rrprovider.c b/randr/rrprovider.c
+index e4bc2bf..e04c18f 100644
+--- a/randr/rrprovider.c
++++ b/randr/rrprovider.c
+@@ -485,3 +485,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider)
+
+ WriteEventsToClient(client, 1, (xEvent *) &pe);
+ }
++
++void
++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen)
++{
++ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
++ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen);
++ RRProviderPtr provider = pScrPriv->provider;
++ RRProviderPtr master_provider = masterPriv->provider;
++
++ if (!provider || !master_provider)
++ return;
++
++ if ((provider->capabilities & RR_Capability_SinkOutput) &&
++ (master_provider->capabilities & RR_Capability_SourceOutput)) {
++ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider);
++ RRInitPrimeSyncProps(pScreen);
++ }
++
++ if ((provider->capabilities & RR_Capability_SourceOffload) &&
++ (master_provider->capabilities & RR_Capability_SinkOffload))
++ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider);
++}
+--
+2.16.2
+
1
0
ports/xorg (3.6): [notify] libglvnd: build system changed to meson/ninja, check revdep afterwards
by crux@crux.nu 19 Sep '21
by crux@crux.nu 19 Sep '21
19 Sep '21
commit d0bc9b0ad1066ad815aa15f34774cd48aef75ea8
Author: Tim Biermann <tbier(a)posteo.de>
Date: Sun Sep 19 20:07:18 2021 +0200
[notify] libglvnd: build system changed to meson/ninja, check revdep afterwards
diff --git a/libglvnd/.footprint b/libglvnd/.footprint
index f96b04d6..bc94a835 100644
--- a/libglvnd/.footprint
+++ b/libglvnd/.footprint
@@ -10,11 +10,6 @@ drwxr-xr-x root/root usr/include/GL/
-rw-r--r-- root/root usr/include/GL/glext.h
-rw-r--r-- root/root usr/include/GL/glx.h
-rw-r--r-- root/root usr/include/GL/glxext.h
-drwxr-xr-x root/root usr/include/GLES/
--rw-r--r-- root/root usr/include/GLES/egl.h
--rw-r--r-- root/root usr/include/GLES/gl.h
--rw-r--r-- root/root usr/include/GLES/glext.h
--rw-r--r-- root/root usr/include/GLES/glplatform.h
drwxr-xr-x root/root usr/include/GLES2/
-rw-r--r-- root/root usr/include/GLES2/gl2.h
-rw-r--r-- root/root usr/include/GLES2/gl2ext.h
@@ -32,38 +27,27 @@ drwxr-xr-x root/root usr/include/glvnd/
-rw-r--r-- root/root usr/include/glvnd/libeglabi.h
-rw-r--r-- root/root usr/include/glvnd/libglxabi.h
drwxr-xr-x root/root usr/lib/
--rwxr-xr-x root/root usr/lib/libEGL.la
-lrwxrwxrwx root/root usr/lib/libEGL.so -> libEGL.so.1.1.0
+lrwxrwxrwx root/root usr/lib/libEGL.so -> libEGL.so.1
lrwxrwxrwx root/root usr/lib/libEGL.so.1 -> libEGL.so.1.1.0
-rwxr-xr-x root/root usr/lib/libEGL.so.1.1.0
--rwxr-xr-x root/root usr/lib/libGL.la
-lrwxrwxrwx root/root usr/lib/libGL.so -> libGL.so.1.7.0
+lrwxrwxrwx root/root usr/lib/libGL.so -> libGL.so.1
lrwxrwxrwx root/root usr/lib/libGL.so.1 -> libGL.so.1.7.0
-rwxr-xr-x root/root usr/lib/libGL.so.1.7.0
--rwxr-xr-x root/root usr/lib/libGLESv1_CM.la
-lrwxrwxrwx root/root usr/lib/libGLESv1_CM.so -> libGLESv1_CM.so.1.2.0
-lrwxrwxrwx root/root usr/lib/libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.2.0
--rwxr-xr-x root/root usr/lib/libGLESv1_CM.so.1.2.0
--rwxr-xr-x root/root usr/lib/libGLESv2.la
-lrwxrwxrwx root/root usr/lib/libGLESv2.so -> libGLESv2.so.2.1.0
+lrwxrwxrwx root/root usr/lib/libGLESv2.so -> libGLESv2.so.2
lrwxrwxrwx root/root usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.1.0
-rwxr-xr-x root/root usr/lib/libGLESv2.so.2.1.0
--rwxr-xr-x root/root usr/lib/libGLX.la
-lrwxrwxrwx root/root usr/lib/libGLX.so -> libGLX.so.0.0.0
+lrwxrwxrwx root/root usr/lib/libGLX.so -> libGLX.so.0
lrwxrwxrwx root/root usr/lib/libGLX.so.0 -> libGLX.so.0.0.0
-rwxr-xr-x root/root usr/lib/libGLX.so.0.0.0
--rwxr-xr-x root/root usr/lib/libGLdispatch.la
-lrwxrwxrwx root/root usr/lib/libGLdispatch.so -> libGLdispatch.so.0.0.0
+lrwxrwxrwx root/root usr/lib/libGLdispatch.so -> libGLdispatch.so.0
lrwxrwxrwx root/root usr/lib/libGLdispatch.so.0 -> libGLdispatch.so.0.0.0
-rwxr-xr-x root/root usr/lib/libGLdispatch.so.0.0.0
--rwxr-xr-x root/root usr/lib/libOpenGL.la
-lrwxrwxrwx root/root usr/lib/libOpenGL.so -> libOpenGL.so.0.0.0
+lrwxrwxrwx root/root usr/lib/libOpenGL.so -> libOpenGL.so.0
lrwxrwxrwx root/root usr/lib/libOpenGL.so.0 -> libOpenGL.so.0.0.0
-rwxr-xr-x root/root usr/lib/libOpenGL.so.0.0.0
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/egl.pc
-rw-r--r-- root/root usr/lib/pkgconfig/gl.pc
--rw-r--r-- root/root usr/lib/pkgconfig/glesv1_cm.pc
-rw-r--r-- root/root usr/lib/pkgconfig/glesv2.pc
-rw-r--r-- root/root usr/lib/pkgconfig/glx.pc
-rw-r--r-- root/root usr/lib/pkgconfig/libglvnd.pc
diff --git a/libglvnd/.signature b/libglvnd/.signature
index 41ac678b..7222ba01 100644
--- a/libglvnd/.signature
+++ b/libglvnd/.signature
@@ -1,6 +1,7 @@
untrusted comment: verify with /etc/ports/xorg.pub
-RWTSGWF5Q7TndHOoivpDddyOt9FzXNo3TaNW2l7aYQY2dmaJTRMeOzgao6A6jqgJcLQ1msKYWAnauna393CkoDNVZ4pg8z0vqgQ=
-SHA256 (Pkgfile) = 1e05e44c732c1b5bae6ae1b1ebe5f2f95779bb9b5b445ce77314129d7871f135
-SHA256 (.footprint) = 6985f48e756c581f213eaf84b8f0234a608ec31c3ead594210caf1e5f0e62f72
+RWTSGWF5Q7TndFpnf6Qyi8ydbNwfcUXTGc4UNWZBQGw9niKaoAjVaAvgwAMaKeq4aBFdQNd3ryNzTYJ7ykPJZkuHM1vq8B84kQI=
+SHA256 (Pkgfile) = 0b5e06fed9bd7f15eb89d4858e5038f0baf9258f9025a7115c6ab985cbf86dc8
+SHA256 (.footprint) = 6798d697285c16167537bef2780cd0682141672178ff89352fb055ce8c3e64bd
SHA256 (libglvnd-1.3.4.tar.gz) = 8f4218d7cdaf89d5b7eced818e810ccbc76f4bb9cba36d66eddac5a7ca892bab
SHA256 (eglplatform.h) = fb6f2775ee3f3536de579b232b6bc48261a6678f91ab39bf8a1c1e05dde68d04
+SHA256 (0001-glx-Add-another-fallback-library-name.patch) = 87565356c31b20e60ded9f17ab76d442dd2cd36bfa4214a0de9699c49106ce43
diff --git a/libglvnd/0001-glx-Add-another-fallback-library-name.patch b/libglvnd/0001-glx-Add-another-fallback-library-name.patch
new file mode 100644
index 00000000..0c8cb952
--- /dev/null
+++ b/libglvnd/0001-glx-Add-another-fallback-library-name.patch
@@ -0,0 +1,30 @@
+From 24606973bfabd75285fbd489264235167ba0f44c Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax(a)redhat.com>
+Date: Thu, 14 Jun 2018 11:25:21 -0400
+Subject: [PATCH] glx: Add another fallback library name
+
+This is mostly to avoid file conflicts with external packaging.
+
+Signed-off-by: Adam Jackson <ajax(a)redhat.com>
+---
+ src/GLX/libglxmapping.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/GLX/libglxmapping.c b/src/GLX/libglxmapping.c
+index be384f8..2016a04 100644
+--- a/src/GLX/libglxmapping.c
++++ b/src/GLX/libglxmapping.c
+@@ -591,6 +591,10 @@ __GLXvendorInfo *__glXLookupVendorByScreen(Display *dpy, const int screen)
+ vendor = __glXLookupVendorByName(FALLBACK_VENDOR_NAME);
+ }
+
++ if (!vendor) {
++ vendor = __glXLookupVendorByName("system");
++ }
++
+ dpyInfo->vendors[screen] = vendor;
+ }
+ __glvndPthreadFuncs.rwlock_unlock(&dpyInfo->vendorLock);
+--
+2.17.0
+
diff --git a/libglvnd/Pkgfile b/libglvnd/Pkgfile
index 8ba36f8c..96122f2e 100644
--- a/libglvnd/Pkgfile
+++ b/libglvnd/Pkgfile
@@ -5,17 +5,29 @@
name=libglvnd
version=1.3.4
-release=1
+release=2
source=(https://github.com/NVIDIA/$name/archive/v$version/$name-$version.ta… \
- eglplatform.h)
+ eglplatform.h
+ 0001-glx-Add-another-fallback-library-name.patch)
build() {
- cd $name-$version
+ #prt-get isinst xorg-libx11 xorg-libxext xorg-xorgproto && PKGMK_GLVND+=' --enable-x11 --enable-glx'; patch -Np1 -d $name-$version -i $SRC/EGL_NO_X11.patch
+ PKGMK_GLVND+=' -D x11=enabled -D glx=enabled'
- autoreconf -if
- ./configure --prefix=/usr
- make
- make DESTDIR=$PKG install
+ # https://src.fedoraproject.org/rpms/libglvnd/tree/rawhide
+ patch -Np1 -d $name-$version -i $SRC/0001-glx-Add-another-fallback-library-name.patch
+
+ meson setup $name-$version build $PKGMK_GLVND \
+ --prefix=/usr \
+ --buildtype=plain \
+ --wrap-mode nodownload \
+ -D b_lto=true \
+ -D b_pie=true \
+ -D gles1=false \
+ -D egl=true \
+ -D tls=disabled
+ meson compile -C build
+ DESTDIR=$PKG meson install -C build
# replace EGL/eglplatform.h with the newer mesa version
install -m 0644 $SRC/eglplatform.h $PKG/usr/include/EGL/
diff --git a/libglvnd/egl-use-device-dispatch-if-at-least-one-vendor-suceeds.patch b/libglvnd/egl-use-device-dispatch-if-at-least-one-vendor-suceeds.patch
new file mode 100644
index 00000000..529e8955
--- /dev/null
+++ b/libglvnd/egl-use-device-dispatch-if-at-least-one-vendor-suceeds.patch
@@ -0,0 +1,37 @@
+From a527411da713b2068974c46d7129326520dc5923 Mon Sep 17 00:00:00 2001
+From: Ronan Pigott <rpigott(a)berkeley.edu>
+Date: Wed, 18 Nov 2020 11:05:59 -0700
+Subject: [PATCH] egl: use device dispatch if at least one vendor suceeds
+
+Currently, in InitDeviceListInternal if any egl vendor fails to list
+its devices for any reason the construction of the device list is
+abandoned. That means that even if we have one vendor successfully
+serving the application, the failure of another vendor library will
+break any api calls related to egl devices.
+
+Instead, if a vendor fails queryDevicesEXT the device mapping logic
+should proceed as if it listed no devices. If the relevant device
+belongs to the failed vendor then the dispatch will still fail with
+EGL_BAD_DEVICE.
+---
+ src/EGL/libeglmapping.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/EGL/libeglmapping.c b/src/EGL/libeglmapping.c
+index c736172..7cf5a87 100644
+--- a/src/EGL/libeglmapping.c
++++ b/src/EGL/libeglmapping.c
+@@ -276,7 +276,9 @@ static EGLBoolean AddVendorDevices(__EGLvendorInfo *vendor)
+ }
+
+ if (!vendor->staticDispatch.queryDevicesEXT(0, NULL, &count)) {
+- return EGL_FALSE;
++ // Even if this vendor fails, we can still return the devices from any
++ // other vendors
++ return EGL_TRUE;
+ }
+ if (count <= 0) {
+ return EGL_TRUE;
+--
+GitLab
+
1
0
ports/xorg (3.6): [notify] mesa: enables wayland platform optionally, makes libvdpau optional
by crux@crux.nu 19 Sep '21
by crux@crux.nu 19 Sep '21
19 Sep '21
commit a941377dae1002c483e5e044b4b1aaba58ebc7bb
Author: Tim Biermann <tbier(a)posteo.de>
Date: Sun Sep 19 19:56:40 2021 +0200
[notify] mesa: enables wayland platform optionally, makes libvdpau optional
diff --git a/mesa/.footprint b/mesa/.footprint
index c4c4810a..86cd2c9e 100644
--- a/mesa/.footprint
+++ b/mesa/.footprint
@@ -62,23 +62,6 @@ drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/gbm.pc
-rw-r--r-- root/root usr/lib/pkgconfig/osmesa.pc
-rw-r--r-- root/root usr/lib/pkgconfig/xatracker.pc
-drwxr-xr-x root/root usr/lib/vdpau/
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_nouveau.so -> libvdpau_nouveau.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_nouveau.so.1 -> libvdpau_nouveau.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_nouveau.so.1.0 -> libvdpau_nouveau.so.1.0.0
--rwxr-xr-x root/root usr/lib/vdpau/libvdpau_nouveau.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r300.so -> libvdpau_r300.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r300.so.1 -> libvdpau_r300.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r300.so.1.0 -> libvdpau_r300.so.1.0.0
--rwxr-xr-x root/root usr/lib/vdpau/libvdpau_r300.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r600.so -> libvdpau_r600.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r600.so.1 -> libvdpau_r600.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r600.so.1.0 -> libvdpau_r600.so.1.0.0
--rwxr-xr-x root/root usr/lib/vdpau/libvdpau_r600.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_radeonsi.so -> libvdpau_radeonsi.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_radeonsi.so.1 -> libvdpau_radeonsi.so.1.0.0
-lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_radeonsi.so.1.0 -> libvdpau_radeonsi.so.1.0.0
--rwxr-xr-x root/root usr/lib/vdpau/libvdpau_radeonsi.so.1.0.0
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/drirc.d/
-rw-r--r-- root/root usr/share/drirc.d/00-mesa-defaults.conf
diff --git a/mesa/.signature b/mesa/.signature
index 72a458f8..75a63e8f 100644
--- a/mesa/.signature
+++ b/mesa/.signature
@@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/xorg.pub
-RWTSGWF5Q7TndOCIwxnKpWZloboTwcKsT/keTNUa+n9D559xCo5uqwsLJ1uXFOKbbunGfomTn+MetF3hlhMbjzZ/bpITy5q+lQc=
-SHA256 (Pkgfile) = 8a2760bbf6cfa9b66abc931ed9f13e508408d5262457ecc9968883462a035a14
-SHA256 (.footprint) = 1f6dc0358b248a7d866b48f5d76add3150a7c1e6670a87da2974916f6c395f39
+RWTSGWF5Q7TndJCYirWDY44CuWYyKkSeaoSCeWNqBBMTg0IsJB7uTOl83iAApRsIYDpHI2XFwxhYKMO39l0S/gU6J/s3dbIzHQk=
+SHA256 (Pkgfile) = 747e0d1c131a95fb07d9fe7fe2c21c4cf740d2018e97deb24424f95e07b17d71
+SHA256 (.footprint) = 85ec0bbe53946c7916adb219ea3a935095c0504bbfce3c3ae35ebd2def11e4dc
SHA256 (mesa-21.2.1.tar.xz) = 2c65e6710b419b67456a48beefd0be827b32db416772e0e363d5f7d54dc01787
diff --git a/mesa/Pkgfile b/mesa/Pkgfile
index 0fa43f1a..34a43a1b 100644
--- a/mesa/Pkgfile
+++ b/mesa/Pkgfile
@@ -1,29 +1,43 @@
# Description: Mesa 3D Graphics Library
# URL: https://www.mesa3d.org/
# Maintainer: CRUX Xorg Team, xorg-ports at crux dot nu
-# Depends on: elfutils libdrm libglvnd libvdpau llvm python3-mako xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm
-# Optional: libva
+# Depends on: elfutils libdrm libglvnd llvm python3-mako xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm
+# Optional: libva libvdpau wayland-protocols
name=mesa
version=21.2.1
-release=1
+release=2
source=(https://archive.mesa3d.org/$name-$version.tar.xz)
build() {
- meson setup build mesa-$version \
+ prt-get isinst glslang && PKGMK_MESA+=' -D vulkan-layers=device-select,intel-nullhw,overlay'
+ prt-get isinst libvdpau && PKGMK_MESA+=' -D gallium-vdpau=enabled' || PKGMK_MESA+=' -D gallium-vdpau=disabled'
+ prt-get isinst wayland-protocols && PKGMK_MESA_PLATFORMS+='wayland'
+ ## for future references
+ #prt-get isinst xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm && PKGMK_MESA_PLATFORMS+=',x11'
+ PKGMK_MESA_PLATFORMS+=',x11'
+
+
+ meson setup build mesa-$version $PKGMK_MESA \
--prefix=/usr \
--sysconfdir=/etc \
--buildtype=plain \
+ --wrap-mode nodownload \
+ -D b_lto=true \
+ -D b_pie=true \
+ -D dri3=enabled \
+ -D egl=enabled \
-D llvm=enabled \
-D shared-llvm=enabled \
-D gbm=enabled \
- -D gles1=enabled \
+ -D gles1=disabled \
-D gles2=enabled \
+ -D glx=dri \
-D osmesa=true \
-D gallium-xa=enabled \
- -D gallium-vdpau=enabled \
- -D platforms=x11 \
-D gallium-drivers=r300,r600,svga,swrast,radeonsi,nouveau,iris,virgl \
+ -D platforms=${PKGMK_MESA_PLATFORMS#,} \
+ -D shared-glapi=enabled \
-D vulkan-drivers=amd,intel \
-D glvnd=true
1
0
ports/opt (3.6): [notify] gexiv2: 0.13.0 -> 0.14.0; new hard depedency: python3-gobject
by crux@crux.nu 19 Sep '21
by crux@crux.nu 19 Sep '21
19 Sep '21
commit 04830fceaa96023f50e4ca13ab8e85e764ffdf3f
Author: Tim Biermann <tbier(a)posteo.de>
Date: Sun Sep 19 12:40:16 2021 +0200
[notify] gexiv2: 0.13.0 -> 0.14.0; new hard depedency: python3-gobject
diff --git a/gexiv2/.footprint b/gexiv2/.footprint
index 526307cb2..22571fe4d 100644
--- a/gexiv2/.footprint
+++ b/gexiv2/.footprint
@@ -14,10 +14,18 @@ drwxr-xr-x root/root usr/lib/
drwxr-xr-x root/root usr/lib/girepository-1.0/
-rw-r--r-- root/root usr/lib/girepository-1.0/GExiv2-0.10.typelib
lrwxrwxrwx root/root usr/lib/libgexiv2.so -> libgexiv2.so.2
-lrwxrwxrwx root/root usr/lib/libgexiv2.so.2 -> libgexiv2.so.2.13.0
--rwxr-xr-x root/root usr/lib/libgexiv2.so.2.13.0
+lrwxrwxrwx root/root usr/lib/libgexiv2.so.2 -> libgexiv2.so.2.14.0
+-rwxr-xr-x root/root usr/lib/libgexiv2.so.2.14.0
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/gexiv2.pc
+drwxr-xr-x root/root usr/lib/python3.9/
+drwxr-xr-x root/root usr/lib/python3.9/site-packages/
+drwxr-xr-x root/root usr/lib/python3.9/site-packages/gi/
+drwxr-xr-x root/root usr/lib/python3.9/site-packages/gi/overrides/
+-rw-r--r-- root/root usr/lib/python3.9/site-packages/gi/overrides/GExiv2.py
+drwxr-xr-x root/root usr/lib/python3.9/site-packages/gi/overrides/__pycache__/
+-rw-r--r-- root/root usr/lib/python3.9/site-packages/gi/overrides/__pycache__/GExiv2.cpython-39.opt-1.pyc
+-rw-r--r-- root/root usr/lib/python3.9/site-packages/gi/overrides/__pycache__/GExiv2.cpython-39.pyc
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/gir-1.0/
-rw-r--r-- root/root usr/share/gir-1.0/GExiv2-0.10.gir
diff --git a/gexiv2/.signature b/gexiv2/.signature
index 3f5539400..fd6dabcb8 100644
--- a/gexiv2/.signature
+++ b/gexiv2/.signature
@@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/cqzQJxOWMtIipG0ANVkkKog9Ib5yroirXNfF6hndbeypGyJLTlso12WWmHJKuUCagWTFj6deRB6ZesKklaLUgw=
-SHA256 (Pkgfile) = b43014d004a8f5afa289a0595ba509a0a073fa1050d7629095b26f102478d49a
-SHA256 (.footprint) = 7fddade10b7c15e9c1192b510a4b1c05ba7c855d610edda857055a526aa046a3
-SHA256 (gexiv2-0.13.0.tar.xz) = e434b6b79f47655c7f42917e4bd9ef6344645df161eeaf30dc742aba09f8e24d
+RWSE3ohX2g5d/T59aWAB++i/sLrQ/VEjEsU7DR8YBm3PfFa1lywmdIYP/rh2KZPiMcQkE6/0RyhhisHkTlM8Hhggtap1GX39+wo=
+SHA256 (Pkgfile) = 0d371b23b0e7cfe51f0a3471586dd9343ec416a6eef62ae4d3011283b497dea0
+SHA256 (.footprint) = ecf3fc7f475f6aa522c4836d43bef7855397e7ecb3b374b0aaf2c385b300c3e4
+SHA256 (gexiv2-0.14.0.tar.xz) = e58279a6ff20b6f64fa499615da5e9b57cf65ba7850b72fafdf17221a9d6d69e
diff --git a/gexiv2/Pkgfile b/gexiv2/Pkgfile
index 0443dd277..4e6231aab 100644
--- a/gexiv2/Pkgfile
+++ b/gexiv2/Pkgfile
@@ -1,21 +1,17 @@
# Description: GObject wrapper around the Exiv2 photo metadata library
# URL: https://wiki.gnome.org/Projects/gexiv2
# Maintainer: Tim Biermann, tbier at posteo dot de
-# Depends on: exiv2 gobject-introspection
-# Optional: python3-gobject vala
+# Depends on: exiv2 python3-gobject
+# Optional: vala
name=gexiv2
-version=0.13.0
+version=0.14.0
release=1
source=(https://download.gnome.org/sources/$name/${version%.*}/$name-$versi…
build() {
- prt-get isinst python3-gobject || export PKGMK_GEXIV+=" -D python3=false"
prt-get isinst vala || PKGMK_GEXIV+=' -D vapi=false'
- # tests will fail if we don't build with python3-gobject..
- prt-get isinst python3-gobject || sed -i '70d' $name-$version/meson.build
-
meson setup build $name-$version $PKGMK_GEXIV \
--prefix=/usr \
--buildtype=plain \
@@ -25,4 +21,8 @@ build() {
-D gtk_doc=false
meson compile -C build -j ${JOBS:-1}
DESTDIR=$PKG meson install -C build
+
+ export PYTHONHASHSEED=0
+ /usr/bin/python3 -m compileall -d /usr/lib/python3.9/site-packages/gi $PKG/usr/lib/python3.9/site-packages/gi
+ /usr/bin/python3 -O -m compileall -d /usr/lib/python3.9/site-packages/gi $PKG/usr/lib/python3.9/site-packages/gi
}
1
0
ports/opt (3.6): [notify] librsvg: dependency change. removed libcroco added brotli
by crux@crux.nu 19 Sep '21
by crux@crux.nu 19 Sep '21
19 Sep '21
commit 5f23d1cb761af01d2fdd855a9cc5896aca04d004
Author: Danny Rawlins <contact(a)romster.me>
Date: Sun Sep 19 15:13:34 2021 +1000
[notify] librsvg: dependency change. removed libcroco added brotli
diff --git a/librsvg/.footprint b/librsvg/.footprint
index 7c98350e4..9e5411a5e 100644
--- a/librsvg/.footprint
+++ b/librsvg/.footprint
@@ -12,10 +12,12 @@ drwxr-xr-x root/root usr/lib/
drwxr-xr-x root/root usr/lib/gdk-pixbuf-2.0/
drwxr-xr-x root/root usr/lib/gdk-pixbuf-2.0/2.10.0/
drwxr-xr-x root/root usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/
+-rw-r--r-- root/root usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.a
-rwxr-xr-x root/root usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.la
-rwxr-xr-x root/root usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
drwxr-xr-x root/root usr/lib/girepository-1.0/
-rw-r--r-- root/root usr/lib/girepository-1.0/Rsvg-2.0.typelib
+-rw-r--r-- root/root usr/lib/librsvg-2.a
-rwxr-xr-x root/root usr/lib/librsvg-2.la
lrwxrwxrwx root/root usr/lib/librsvg-2.so -> librsvg-2.so.2.48.0
lrwxrwxrwx root/root usr/lib/librsvg-2.so.2 -> librsvg-2.so.2.48.0
diff --git a/librsvg/.signature b/librsvg/.signature
index f2dcf65f8..224219e8c 100644
--- a/librsvg/.signature
+++ b/librsvg/.signature
@@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/dfOv2+mb96lk2VoSd4gwGlI9VInlcHSZbPFOhtpoRSucExJeqFsy5s7Obrqqq9p2PmuH151PjKfGAPhl9X9XAU=
-SHA256 (Pkgfile) = e655a6175d3e4abea7b808af6fdbe204c4057cdad88037b34a6625e4f7a698c1
+RWSE3ohX2g5d/RP43tHU+7xh35hfqMsflGrTWKRxAVg1z2Pe1Nr7pyReULOOM1fP9Tj59LzhK9ooYuP6tIctVMWw8T/fP1Us4Qs=
+SHA256 (Pkgfile) = ada86eb249264df1290976dcf4a273fd01cfd899e09192f465072e06a9b467ea
SHA256 (.footprint) = 2bd9011b555172b6c67db297fda5e2bc17a149e3f18573210132f937af38a4cd
-SHA256 (librsvg-2.51.4.tar.xz) = 0b87d61de9b973aac1fdb9583368b9a893e67f5f7cb75c3e8f7de142557aca00
+SHA256 (librsvg-2.52.0.tar.xz) = bd821fb3e16494b61f5185addd23b726b064f203122b3ab4b3d5d7a44e6bf393
diff --git a/librsvg/Pkgfile b/librsvg/Pkgfile
index 09f3b6f23..28d27ce07 100644
--- a/librsvg/Pkgfile
+++ b/librsvg/Pkgfile
@@ -1,8 +1,8 @@
# Description: SVG rendering library with cairo backend
# URL: https://wiki.gnome.org/Projects/LibRsvg
# Maintainer: Danny Rawlins, crux at romster dot me
-# Depends on: gdk-pixbuf libcroco pango rust
-# Optional: sccache
+# Depends on: brotli gdk-pixbuf pango rust
+# Optional: graphite2 sccache
name=librsvg
version=2.52.0
@@ -11,14 +11,12 @@ source=(https://download.gnome.org/sources/$name/${version%.*}/$name-$versi…
build() {
cd $name-$version
- export LC_ALL=C \
- CARGO_PROFILE_RELEASE_LTO=true \
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
mkdir "$PKGMK_SOURCE_DIR/rust" || true
export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"
+ # causes segfault if set
unset __GL_NO_DSO_FINALIZER
./configure \
@@ -26,10 +24,8 @@ build() {
--disable-gtk-doc \
--disable-tools \
--disable-debug \
- --disable-static \
- --disable-nls
-
- sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' libtool
+ --disable-nls \
+ --enable-pixbuf-loader
make
make DESTDIR=$PKG install
1
0
ports/core (3.6): [notify] glibc-32: fixed upstream bugs and CVE-2021-33574 denial of service (application crash) bug
by crux@crux.nu 18 Sep '21
by crux@crux.nu 18 Sep '21
18 Sep '21
commit 181932982d2d6aa16fbc5739e72341eadb672e09
Author: Danny Rawlins <contact(a)romster.me>
Date: Sat Sep 18 23:32:19 2021 +1000
[notify] glibc-32: fixed upstream bugs and CVE-2021-33574 denial of service (application crash) bug
diff --git a/glibc-32/.signature b/glibc-32/.signature
index f749425f..2fb0c92f 100644
--- a/glibc-32/.signature
+++ b/glibc-32/.signature
@@ -1,8 +1,8 @@
untrusted comment: verify with /etc/ports/core.pub
-RWRJc1FUaeVeqsImCrnu91cf6KEXS52UXALzInBBj8j/7tdWU6W8GeQhtQXjP2SxeFlpihMX07JTxkM9R4VuH9jYZbLwbZa+pwQ=
-SHA256 (Pkgfile) = 246974317c78736d3518e5bf328b3908d3af6e7c05527b468d5cd28ca283d74e
+RWRJc1FUaeVeqj6i1SWfeAprBs5+hbHng33d+BFxFRGCsMbJ+3fw/owHyw4U56/PmHiA9H2OW0HGk1rpe0oXfsWs33xYl4FLNQ8=
+SHA256 (Pkgfile) = 7e8956b17109fe3f039c196484c4bc2a443601d32646cca1b04f3628791daa96
SHA256 (.footprint) = 45836a310a6801080a61130aca376091caab990a0c75d9fc039fcb7ad7298642
SHA256 (glibc-2.32.tar.xz) = 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
SHA256 (linux-5.4.72.tar.xz) = 0e24645bd56fe5b55a7a662895f5562c103d71b54d097281f0c9c71ff22c1172
-SHA256 (glibc-2.32-3.patch) = 6d84a6054984e89c4b139dfa1a29561ee2f146bafa479f1c465700220a6aee73
+SHA256 (glibc-2.32-5.patch) = 195b66ab42fd8fa82119b720e0432faebac2087cd16943d230d4839e4d308dcf
SHA256 (lib32.conf) = 2f174d2bcefe1c29327690514f34d6970fffdd54398320ca23a11b5f1e3c9b2d
diff --git a/glibc-32/Pkgfile b/glibc-32/Pkgfile
index c0ceb173..b5e259fc 100644
--- a/glibc-32/Pkgfile
+++ b/glibc-32/Pkgfile
@@ -4,10 +4,10 @@
name=glibc-32
version=2.32
-release=3
-source=(http://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz \
- http://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.72.tar.xz \
- glibc-$version-3.patch lib32.conf)
+release=4
+source=(https://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz \
+ https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.72.tar.xz \
+ glibc-$version-5.patch lib32.conf)
build() {
# install kernel headers
@@ -17,7 +17,7 @@ build() {
make INSTALL_HDR_PATH=$PKG/usr headers_install
chown root:root $PKG/usr
- patch -p1 -d $SRC/glibc-${version:0:4} -i $SRC/glibc-$version-3.patch
+ patch -p1 -d $SRC/glibc-${version:0:4} -i $SRC/glibc-$version-5.patch
mkdir $SRC/build
cd $SRC/build
diff --git a/glibc-32/glibc-2.32-3.patch b/glibc-32/glibc-2.32-5.patch
similarity index 72%
rename from glibc-32/glibc-2.32-3.patch
rename to glibc-32/glibc-2.32-5.patch
index 8195ec34..b08b1624 100644
--- a/glibc-32/glibc-2.32-3.patch
+++ b/glibc-32/glibc-2.32-5.patch
@@ -1,114 +1,7 @@
-diff --git a/NEWS b/NEWS
-index 485b8ddffa..f278041512 100644
---- a/NEWS
-+++ b/NEWS
-@@ -5,6 +5,25 @@ See the end for copying conditions.
- Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
- using `glibc' in the "product" field.
-
-+The following bugs are resolved with this release:
-+
-+ [20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
-+ [26224] iconv hangs when converting some invalid inputs from several IBM
-+ character sets (CVE-2020-27618)
-+ [26534] libm.so 2.32 SIGILL in pow() due to FMA4 instruction on non-FMA4
-+ system
-+ [26555] string: strerrorname_np does not return the documented value
-+ [26600] Transaction ID collisions cause slow DNS lookups in getaddrinfo
-+ [26636] libc: 32-bit shmctl(IPC_INFO) crashes when shminfo struct is
-+ at the end of a memory mapping
-+ [26637] libc: semctl SEM_STAT_ANY fails to pass the buffer specified
-+ by the caller to the kernel
-+ [26639] libc: msgctl IPC_INFO and MSG_INFO return garbage
-+ [26853] aarch64: Missing unwind information in statically linked startup code
-+ [26932] libc: sh: Multiple floating point functions defined as stubs only
-+ [27130] "rep movsb" performance issue
-+ [27177] GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
-+
- Version 2.32
-
- Major new features:
-@@ -185,6 +204,10 @@ Security related changes:
- Dytrych of the Cisco Security Assessment and Penetration Team (See
- TALOS-2020-1019).
-
-+ CVE-2020-27618: An infinite loop has been fixed in the iconv program when
-+ invoked with input containing redundant shift sequences in the IBM1364,
-+ IBM1371, IBM1388, IBM1390, or IBM1399 character sets.
-+
- The following bugs are resolved with this release:
-
- [9809] localedata: ckb_IQ: new Kurdish Sorani locale
-diff --git a/Rules b/Rules
-index 8b771f6095..beab969fde 100644
---- a/Rules
-+++ b/Rules
-@@ -155,6 +155,7 @@ xtests: tests $(xtests-special)
- else
- tests: $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \
- $(tests-container:%=$(objpfx)%.out) \
-+ $(tests-mcheck:%=$(objpfx)%-mcheck.out) \
- $(tests-special) $(tests-printers-out)
- xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-special)
- endif
-@@ -165,7 +166,7 @@ ifeq ($(run-built-tests),no)
- tests-expected =
- else
- tests-expected = $(tests) $(tests-internal) $(tests-printers) \
-- $(tests-container)
-+ $(tests-container) $(tests-mcheck:%=%-mcheck)
- endif
- tests:
- $(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
-@@ -191,6 +192,7 @@ else
- binaries-pie-tests =
- binaries-pie-notests =
- endif
-+binaries-mcheck-tests = $(tests-mcheck:%=%-mcheck)
- else
- binaries-all-notests =
- binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs)
-@@ -200,6 +202,7 @@ binaries-static-tests =
- binaries-static =
- binaries-pie-tests =
- binaries-pie-notests =
-+binaries-mcheck-tests =
- endif
-
- binaries-pie = $(binaries-pie-tests) $(binaries-pie-notests)
-@@ -223,6 +226,14 @@ $(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
- $(+link-tests)
- endif
-
-+ifneq "$(strip $(binaries-mcheck-tests))" ""
-+$(addprefix $(objpfx),$(binaries-mcheck-tests)): %-mcheck: %.o \
-+ $(link-extra-libs-tests) \
-+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
-+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
-+ $(+link-tests)
-+endif
-+
- ifneq "$(strip $(binaries-pie-tests))" ""
- $(addprefix $(objpfx),$(binaries-pie-tests)): %: %.o \
- $(link-extra-libs-tests) \
-@@ -253,6 +264,12 @@ $(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
- $(+link-static-tests)
- endif
-
-+# All mcheck tests will be run with MALLOC_CHECK_=3
-+define mcheck-ENVS
-+$(1)-mcheck-ENV = MALLOC_CHECK_=3
-+endef
-+$(foreach t,$(tests-mcheck),$(eval $(call mcheck-ENVS,$(t))))
-+
- ifneq "$(strip $(tests) $(tests-internal) $(xtests) $(test-srcs))" ""
- # These are the implicit rules for making test outputs
- # from the test programs and whatever input files are present.
-diff --git a/debug/Makefile b/debug/Makefile
-index 3a60d7af7a..0036edd187 100644
---- a/debug/Makefile
-+++ b/debug/Makefile
-@@ -51,7 +51,7 @@ routines = backtrace backtracesyms backtracesymsfd noophooks \
+diff -pruN glibc-2.32.orig/debug/Makefile glibc-2.32/debug/Makefile
+--- glibc-2.32.orig/debug/Makefile 2021-09-18 21:02:32.642182626 +1000
++++ glibc-2.32/debug/Makefile 2021-09-18 21:03:05.310302219 +1000
+@@ -51,7 +51,7 @@ routines = backtrace backtracesyms back
explicit_bzero_chk \
stack_chk_fail fortify_fail \
$(static-only-routines)
@@ -117,11 +10,9 @@ index 3a60d7af7a..0036edd187 100644
# Don't add stack_chk_fail_local.o to libc.a since __stack_chk_fail_local
# is an alias of __stack_chk_fail in stack_chk_fail.o.
-diff --git a/debug/warning-nop.c b/debug/warning-nop.c
-deleted file mode 100644
-index 4ab7e182b7..0000000000
---- a/debug/warning-nop.c
-+++ /dev/null
+diff -pruN glibc-2.32.orig/debug/warning-nop.c glibc-2.32/debug/warning-nop.c
+--- glibc-2.32.orig/debug/warning-nop.c 2021-09-18 21:02:32.642182626 +1000
++++ glibc-2.32/debug/warning-nop.c 1970-01-01 10:00:00.000000000 +1000
@@ -1,70 +0,0 @@
-/* Dummy nop functions to elicit link-time warnings.
- Copyright (C) 2005-2020 Free Software Foundation, Inc.
@@ -193,24 +84,10 @@ index 4ab7e182b7..0000000000
-#define __builtin_object_size(bos, level) 0
-
-#include <string.h>
-diff --git a/elf/Makefile b/elf/Makefile
-index 0b78721848..355e70037b 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -1381,6 +1381,8 @@ CFLAGS-ifuncmain7pie.c += $(pie-ccflag)
- CFLAGS-ifuncmain9pie.c += $(pie-ccflag)
- CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag)
-
-+LDFLAGS-ifuncmain6pie = -Wl,-z,lazy
-+
- $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so
- $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o
- $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so
-diff --git a/elf/dl-load.c b/elf/dl-load.c
-index e39980fb19..71867e7c1a 100644
---- a/elf/dl-load.c
-+++ b/elf/dl-load.c
-@@ -855,10 +855,12 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
+diff -pruN glibc-2.32.orig/elf/dl-load.c glibc-2.32/elf/dl-load.c
+--- glibc-2.32.orig/elf/dl-load.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/dl-load.c 2021-09-18 21:03:05.311302253 +1000
+@@ -855,10 +855,12 @@ lose (int code, int fd, const char *name
/* Process PT_GNU_PROPERTY program header PH in module L after
PT_LOAD segments are mapped. Only one NT_GNU_PROPERTY_TYPE_0
@@ -225,7 +102,7 @@ index e39980fb19..71867e7c1a 100644
{
const ElfW(Nhdr) *note = (const void *) (ph->p_vaddr + l->l_addr);
const ElfW(Addr) size = ph->p_memsz;
-@@ -905,7 +907,7 @@ _dl_process_pt_gnu_property (struct link_map *l, const ElfW(Phdr) *ph)
+@@ -905,7 +907,7 @@ _dl_process_pt_gnu_property (struct link
last_type = type;
/* Target specific property processing. */
@@ -234,7 +111,7 @@ index e39980fb19..71867e7c1a 100644
return;
/* Check the next property item. */
-@@ -1251,21 +1253,6 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd,
+@@ -1251,21 +1253,6 @@ _dl_map_object_from_fd (const char *name
maplength, has_holes, loader);
if (__glibc_unlikely (errstring != NULL))
goto call_lose;
@@ -256,7 +133,7 @@ index e39980fb19..71867e7c1a 100644
}
if (l->l_ld == 0)
-@@ -1377,6 +1364,21 @@ cannot enable executable stack as shared object requires");
+@@ -1377,6 +1364,21 @@ cannot enable executable stack as shared
if (l->l_tls_initimage != NULL)
l->l_tls_initimage = (char *) l->l_tls_initimage + l->l_addr;
@@ -278,10 +155,99 @@ index e39980fb19..71867e7c1a 100644
/* We are done mapping in the file. We no longer need the descriptor. */
if (__glibc_unlikely (__close_nocancel (fd) != 0))
{
-diff --git a/elf/ifuncmain6pie.c b/elf/ifuncmain6pie.c
-index 04faeb86ef..4a01906836 100644
---- a/elf/ifuncmain6pie.c
-+++ b/elf/ifuncmain6pie.c
+diff -pruN glibc-2.32.orig/elf/dl-tunables.c glibc-2.32/elf/dl-tunables.c
+--- glibc-2.32.orig/elf/dl-tunables.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/dl-tunables.c 2021-09-18 21:03:05.311302253 +1000
+@@ -177,6 +177,7 @@ parse_tunables (char *tunestr, char *val
+ return;
+
+ char *p = tunestr;
++ size_t off = 0;
+
+ while (true)
+ {
+@@ -190,7 +191,11 @@ parse_tunables (char *tunestr, char *val
+ /* If we reach the end of the string before getting a valid name-value
+ pair, bail out. */
+ if (p[len] == '\0')
+- return;
++ {
++ if (__libc_enable_secure)
++ tunestr[off] = '\0';
++ return;
++ }
+
+ /* We did not find a valid name-value pair before encountering the
+ colon. */
+@@ -216,35 +221,28 @@ parse_tunables (char *tunestr, char *val
+
+ if (tunable_is_name (cur->name, name))
+ {
+- /* If we are in a secure context (AT_SECURE) then ignore the tunable
+- unless it is explicitly marked as secure. Tunable values take
+- precedence over their envvar aliases. */
++ /* If we are in a secure context (AT_SECURE) then ignore the
++ tunable unless it is explicitly marked as secure. Tunable
++ values take precedence over their envvar aliases. We write
++ the tunables that are not SXID_ERASE back to TUNESTR, thus
++ dropping all SXID_ERASE tunables and any invalid or
++ unrecognized tunables. */
+ if (__libc_enable_secure)
+ {
+- if (cur->security_level == TUNABLE_SECLEVEL_SXID_ERASE)
++ if (cur->security_level != TUNABLE_SECLEVEL_SXID_ERASE)
+ {
+- if (p[len] == '\0')
+- {
+- /* Last tunable in the valstring. Null-terminate and
+- return. */
+- *name = '\0';
+- return;
+- }
+- else
+- {
+- /* Remove the current tunable from the string. We do
+- this by overwriting the string starting from NAME
+- (which is where the current tunable begins) with
+- the remainder of the string. We then have P point
+- to NAME so that we continue in the correct
+- position in the valstring. */
+- char *q = &p[len + 1];
+- p = name;
+- while (*q != '\0')
+- *name++ = *q++;
+- name[0] = '\0';
+- len = 0;
+- }
++ if (off > 0)
++ tunestr[off++] = ':';
++
++ const char *n = cur->name;
++
++ while (*n != '\0')
++ tunestr[off++] = *n++;
++
++ tunestr[off++] = '=';
++
++ for (size_t j = 0; j < len; j++)
++ tunestr[off++] = value[j];
+ }
+
+ if (cur->security_level != TUNABLE_SECLEVEL_NONE)
+@@ -257,9 +255,7 @@ parse_tunables (char *tunestr, char *val
+ }
+ }
+
+- if (p[len] == '\0')
+- return;
+- else
++ if (p[len] != '\0')
+ p += len + 1;
+ }
+ }
+diff -pruN glibc-2.32.orig/elf/ifuncmain6pie.c glibc-2.32/elf/ifuncmain6pie.c
+--- glibc-2.32.orig/elf/ifuncmain6pie.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/ifuncmain6pie.c 2021-09-18 21:03:05.311302253 +1000
@@ -9,7 +9,6 @@
#include "ifunc-sel.h"
@@ -327,10 +293,9 @@ index 04faeb86ef..4a01906836 100644
if (foo () != -30)
abort ();
-diff --git a/elf/ifuncmod6.c b/elf/ifuncmod6.c
-index 2e16c1d06d..2f6d0715e6 100644
---- a/elf/ifuncmod6.c
-+++ b/elf/ifuncmod6.c
+diff -pruN glibc-2.32.orig/elf/ifuncmod6.c glibc-2.32/elf/ifuncmod6.c
+--- glibc-2.32.orig/elf/ifuncmod6.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/ifuncmod6.c 2021-09-18 21:03:05.311302253 +1000
@@ -4,7 +4,7 @@ extern int foo (void);
typedef int (*foo_p) (void);
@@ -352,11 +317,31 @@ index 2e16c1d06d..2f6d0715e6 100644
- return foo;
+ return foo ();
}
-diff --git a/elf/rtld.c b/elf/rtld.c
-index 5b882163fa..14a42ed00a 100644
---- a/elf/rtld.c
-+++ b/elf/rtld.c
-@@ -1534,10 +1534,10 @@ of this helper program; chances are you did not intend to run this program.\n\
+diff -pruN glibc-2.32.orig/elf/Makefile glibc-2.32/elf/Makefile
+--- glibc-2.32.orig/elf/Makefile 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/Makefile 2021-09-18 21:03:05.311302253 +1000
+@@ -1381,6 +1381,8 @@ CFLAGS-ifuncmain7pie.c += $(pie-ccflag)
+ CFLAGS-ifuncmain9pie.c += $(pie-ccflag)
+ CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag)
+
++LDFLAGS-ifuncmain6pie = -Wl,-z,lazy
++
+ $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so
+ $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o
+ $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so
+@@ -1630,8 +1632,6 @@ $(objpfx)tst-nodelete-dlclose.out: $(obj
+
+ tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \
+ LD_HWCAP_MASK=0x1
+-tst-env-setuid-tunables-ENV = \
+- GLIBC_TUNABLES=glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096
+
+ $(objpfx)tst-debug1: $(libdl)
+ $(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so
+diff -pruN glibc-2.32.orig/elf/rtld.c glibc-2.32/elf/rtld.c
+--- glibc-2.32.orig/elf/rtld.c 2021-09-18 21:02:32.644182694 +1000
++++ glibc-2.32/elf/rtld.c 2021-09-18 21:03:05.311302253 +1000
+@@ -1534,10 +1534,10 @@ of this helper program; chances are you
switch (ph[-1].p_type)
{
case PT_NOTE:
@@ -369,25 +354,390 @@ index 5b882163fa..14a42ed00a 100644
break;
}
-diff --git a/iconv/Versions b/iconv/Versions
-index 8a5f4cf780..d51af52fa3 100644
---- a/iconv/Versions
-+++ b/iconv/Versions
-@@ -6,7 +6,9 @@ libc {
- GLIBC_PRIVATE {
- # functions shared with iconv program
- __gconv_get_alias_db; __gconv_get_cache; __gconv_get_modules_db;
-- __gconv_open; __gconv_create_spec;
+diff -pruN glibc-2.32.orig/elf/tst-env-setuid.c glibc-2.32/elf/tst-env-setuid.c
+--- glibc-2.32.orig/elf/tst-env-setuid.c 2021-09-18 21:02:32.644182694 +1000
++++ glibc-2.32/elf/tst-env-setuid.c 2021-09-18 21:03:05.311302253 +1000
+@@ -29,173 +29,12 @@
+ #include <sys/wait.h>
+ #include <unistd.h>
+
++#include <support/check.h>
+ #include <support/support.h>
+ #include <support/test-driver.h>
++#include <support/capture_subprocess.h>
+
+ static char SETGID_CHILD[] = "setgid-child";
+-#define CHILD_STATUS 42
+-
+-/* Return a GID which is not our current GID, but is present in the
+- supplementary group list. */
+-static gid_t
+-choose_gid (void)
+-{
+- const int count = 64;
+- gid_t groups[count];
+- int ret = getgroups (count, groups);
+- if (ret < 0)
+- {
+- printf ("getgroups: %m\n");
+- exit (1);
+- }
+- gid_t current = getgid ();
+- for (int i = 0; i < ret; ++i)
+- {
+- if (groups[i] != current)
+- return groups[i];
+- }
+- return 0;
+-}
+-
+-/* Spawn and execute a program and verify that it returns the CHILD_STATUS. */
+-static pid_t
+-do_execve (char **args)
+-{
+- pid_t kid = vfork ();
+-
+- if (kid < 0)
+- {
+- printf ("vfork: %m\n");
+- return -1;
+- }
+-
+- if (kid == 0)
+- {
+- /* Child process. */
+- execve (args[0], args, environ);
+- _exit (-errno);
+- }
+-
+- if (kid < 0)
+- return 1;
+-
+- int status;
+-
+- if (waitpid (kid, &status, 0) < 0)
+- {
+- printf ("waitpid: %m\n");
+- return 1;
+- }
+-
+- if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
+- return EXIT_UNSUPPORTED;
+-
+- if (!WIFEXITED (status) || WEXITSTATUS (status) != CHILD_STATUS)
+- {
+- printf ("Unexpected exit status %d from child process\n",
+- WEXITSTATUS (status));
+- return 1;
+- }
+- return 0;
+-}
+-
+-/* Copies the executable into a restricted directory, so that we can
+- safely make it SGID with the TARGET group ID. Then runs the
+- executable. */
+-static int
+-run_executable_sgid (gid_t target)
+-{
+- char *dirname = xasprintf ("%s/tst-tunables-setuid.%jd",
+- test_dir, (intmax_t) getpid ());
+- char *execname = xasprintf ("%s/bin", dirname);
+- int infd = -1;
+- int outfd = -1;
+- int ret = 0;
+- if (mkdir (dirname, 0700) < 0)
+- {
+- printf ("mkdir: %m\n");
+- goto err;
+- }
+- infd = open ("/proc/self/exe", O_RDONLY);
+- if (infd < 0)
+- {
+- printf ("open (/proc/self/exe): %m\n");
+- goto err;
+- }
+- outfd = open (execname, O_WRONLY | O_CREAT | O_EXCL, 0700);
+- if (outfd < 0)
+- {
+- printf ("open (%s): %m\n", execname);
+- goto err;
+- }
+- char buf[4096];
+- for (;;)
+- {
+- ssize_t rdcount = read (infd, buf, sizeof (buf));
+- if (rdcount < 0)
+- {
+- printf ("read: %m\n");
+- goto err;
+- }
+- if (rdcount == 0)
+- break;
+- char *p = buf;
+- char *end = buf + rdcount;
+- while (p != end)
+- {
+- ssize_t wrcount = write (outfd, buf, end - p);
+- if (wrcount == 0)
+- errno = ENOSPC;
+- if (wrcount <= 0)
+- {
+- printf ("write: %m\n");
+- goto err;
+- }
+- p += wrcount;
+- }
+- }
+- if (fchown (outfd, getuid (), target) < 0)
+- {
+- printf ("fchown (%s): %m\n", execname);
+- goto err;
+- }
+- if (fchmod (outfd, 02750) < 0)
+- {
+- printf ("fchmod (%s): %m\n", execname);
+- goto err;
+- }
+- if (close (outfd) < 0)
+- {
+- printf ("close (outfd): %m\n");
+- goto err;
+- }
+- if (close (infd) < 0)
+- {
+- printf ("close (infd): %m\n");
+- goto err;
+- }
+-
+- char *args[] = {execname, SETGID_CHILD, NULL};
+-
+- ret = do_execve (args);
+-
+-err:
+- if (outfd >= 0)
+- close (outfd);
+- if (infd >= 0)
+- close (infd);
+- if (execname)
+- {
+- unlink (execname);
+- free (execname);
+- }
+- if (dirname)
+- {
+- rmdir (dirname);
+- free (dirname);
+- }
+- return ret;
+-}
+
+ #ifndef test_child
+ static int
+@@ -256,40 +95,32 @@ do_test (int argc, char **argv)
+ if (argc == 2 && strcmp (argv[1], SETGID_CHILD) == 0)
+ {
+ if (getgid () == getegid ())
+- {
+- /* This can happen if the file system is mounted nosuid. */
+- fprintf (stderr, "SGID failed: GID and EGID match (%jd)\n",
+- (intmax_t) getgid ());
+- exit (EXIT_UNSUPPORTED);
+- }
++ /* This can happen if the file system is mounted nosuid. */
++ FAIL_UNSUPPORTED ("SGID failed: GID and EGID match (%jd)\n",
++ (intmax_t) getgid ());
+
+ int ret = test_child ();
+
+ if (ret != 0)
+ exit (1);
+
+- exit (CHILD_STATUS);
++ exit (EXIT_SUCCESS);
+ }
+ else
+ {
+ if (test_parent () != 0)
+ exit (1);
+
+- /* Try running a setgid program. */
+- gid_t target = choose_gid ();
+- if (target == 0)
+- {
+- fprintf (stderr,
+- "Could not find a suitable GID for user %jd, skipping test\n",
+- (intmax_t) getuid ());
+- exit (0);
+- }
++ int status = support_capture_subprogram_self_sgid (SETGID_CHILD);
+
+- return run_executable_sgid (target);
+- }
++ if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
++ return EXIT_UNSUPPORTED;
++
++ if (!WIFEXITED (status))
++ FAIL_EXIT1 ("Unexpected exit status %d from child process\n", status);
+
+- /* Something went wrong and our argv was corrupted. */
+- _exit (1);
++ return 0;
++ }
+ }
+
+ #define TEST_FUNCTION_ARGV do_test
+diff -pruN glibc-2.32.orig/elf/tst-env-setuid-tunables.c glibc-2.32/elf/tst-env-setuid-tunables.c
+--- glibc-2.32.orig/elf/tst-env-setuid-tunables.c 2021-09-18 21:02:32.644182694 +1000
++++ glibc-2.32/elf/tst-env-setuid-tunables.c 2021-09-18 21:03:05.311302253 +1000
+@@ -25,35 +25,76 @@
+ #include "config.h"
+ #undef _LIBC
+
+-#define test_parent test_parent_tunables
+-#define test_child test_child_tunables
++#include <errno.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <stdint.h>
++#include <stdio.h>
++#include <string.h>
++#include <sys/stat.h>
++#include <sys/wait.h>
++#include <unistd.h>
++#include <intprops.h>
++#include <array_length.h>
++
++#include <support/check.h>
++#include <support/support.h>
++#include <support/test-driver.h>
++#include <support/capture_subprocess.h>
+
+-static int test_child_tunables (void);
+-static int test_parent_tunables (void);
+-
+-#include "tst-env-setuid.c"
++const char *teststrings[] =
++{
++ "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.check=2:glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096:glibc.malloc.check=2",
++ "glibc.malloc.perturb=0x800",
++ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.perturb=0x800:not_valid.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.not_valid.check=2:glibc.malloc.mmap_threshold=4096",
++ "not_valid.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.garbage=2:glibc.maoc.mmap_threshold=4096:glibc.malloc.check=2",
++ "glibc.malloc.check=4:glibc.malloc.garbage=2:glibc.maoc.mmap_threshold=4096",
++ ":glibc.malloc.garbage=2:glibc.malloc.check=1",
++ "glibc.malloc.check=1:glibc.malloc.check=2",
++ "not_valid.malloc.check=2",
++ "glibc.not_valid.check=2",
++};
+
+-#define CHILD_VALSTRING_VALUE "glibc.malloc.mmap_threshold=4096"
+-#define PARENT_VALSTRING_VALUE \
+- "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096"
++const char *resultstrings[] =
++{
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.perturb=0x800",
++ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "",
++ "",
++ "",
++ "",
++ "",
++ "",
++};
+
+ static int
+-test_child_tunables (void)
++test_child (int off)
+ {
+ const char *val = getenv ("GLIBC_TUNABLES");
+
+ #if HAVE_TUNABLES
+- if (val != NULL && strcmp (val, CHILD_VALSTRING_VALUE) == 0)
++ if (val != NULL && strcmp (val, resultstrings[off]) == 0)
+ return 0;
+
+ if (val != NULL)
+- printf ("Unexpected GLIBC_TUNABLES VALUE %s\n", val);
++ printf ("[%d] Unexpected GLIBC_TUNABLES VALUE %s\n", off, val);
+
+ return 1;
+ #else
+ if (val != NULL)
+ {
+- printf ("GLIBC_TUNABLES not cleared\n");
++ printf ("[%d] GLIBC_TUNABLES not cleared\n", off);
+ return 1;
+ }
+ return 0;
+@@ -61,15 +102,48 @@ test_child_tunables (void)
+ }
+
+ static int
+-test_parent_tunables (void)
++do_test (int argc, char **argv)
+ {
+- const char *val = getenv ("GLIBC_TUNABLES");
++ /* Setgid child process. */
++ if (argc == 2)
++ {
++ if (getgid () == getegid ())
++ /* This can happen if the file system is mounted nosuid. */
++ FAIL_UNSUPPORTED ("SGID failed: GID and EGID match (%jd)\n",
++ (intmax_t) getgid ());
+
+- if (val != NULL && strcmp (val, PARENT_VALSTRING_VALUE) == 0)
+- return 0;
++ int ret = test_child (atoi (argv[1]));
+
+- if (val != NULL)
+- printf ("Unexpected GLIBC_TUNABLES VALUE %s\n", val);
++ if (ret != 0)
++ exit (1);
+
+- return 1;
++ exit (EXIT_SUCCESS);
++ }
++ else
++ {
++ int ret = 0;
++
++ /* Spawn tests. */
++ for (int i = 0; i < array_length (teststrings); i++)
++ {
++ char buf[INT_BUFSIZE_BOUND (int)];
++
++ printf ("Spawned test for %s (%d)\n", teststrings[i], i);
++ snprintf (buf, sizeof (buf), "%d\n", i);
++ if (setenv ("GLIBC_TUNABLES", teststrings[i], 1) != 0)
++ exit (1);
++
++ int status = support_capture_subprogram_self_sgid (buf);
++
++ /* Bail out early if unsupported. */
++ if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
++ return EXIT_UNSUPPORTED;
++
++ ret |= status;
++ }
++ return ret;
++ }
+ }
+
-+ # functions used elsewhere in glibc
-+ __gconv_open; __gconv_create_spec; __gconv_destroy_spec;
-
- # function used by the gconv modules
- __gconv_transliterate;
-diff --git a/iconv/gconv_charset.c b/iconv/gconv_charset.c
-index 6ccd0773cc..4ba0aa99f5 100644
---- a/iconv/gconv_charset.c
-+++ b/iconv/gconv_charset.c
++#define TEST_FUNCTION_ARGV do_test
++#include <support/test-driver.c>
+diff -pruN glibc-2.32.orig/iconv/gconv_charset.c glibc-2.32/iconv/gconv_charset.c
+--- glibc-2.32.orig/iconv/gconv_charset.c 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/gconv_charset.c 2021-09-18 21:03:05.311302253 +1000
@@ -216,3 +216,13 @@ out:
return ret;
}
@@ -402,10 +752,9 @@ index 6ccd0773cc..4ba0aa99f5 100644
+ return;
+}
+libc_hidden_def (__gconv_destroy_spec)
-diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h
-index b39b09aea1..e9c122cf7e 100644
---- a/iconv/gconv_charset.h
-+++ b/iconv/gconv_charset.h
+diff -pruN glibc-2.32.orig/iconv/gconv_charset.h glibc-2.32/iconv/gconv_charset.h
+--- glibc-2.32.orig/iconv/gconv_charset.h 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/gconv_charset.h 2021-09-18 21:03:05.311302253 +1000
@@ -48,33 +48,6 @@
#define GCONV_IGNORE_ERRORS_SUFFIX "IGNORE"
@@ -440,11 +789,10 @@ index b39b09aea1..e9c122cf7e 100644
/* This function copies in-order, characters from the source 's' that are
either alpha-numeric or one in one of these: "_-.,:/" - into the destination
'wp' while dropping all other characters. In the process, it converts all
-diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h
-index e86938dae7..f721ce30ff 100644
---- a/iconv/gconv_int.h
-+++ b/iconv/gconv_int.h
-@@ -152,6 +152,27 @@ extern int __gconv_open (struct gconv_spec *conv_spec,
+diff -pruN glibc-2.32.orig/iconv/gconv_int.h glibc-2.32/iconv/gconv_int.h
+--- glibc-2.32.orig/iconv/gconv_int.h 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/gconv_int.h 2021-09-18 21:03:05.311302253 +1000
+@@ -152,6 +152,27 @@ extern int __gconv_open (struct gconv_sp
__gconv_t *handle, int flags);
libc_hidden_proto (__gconv_open)
@@ -472,11 +820,10 @@ index e86938dae7..f721ce30ff 100644
/* Free resources associated with transformation descriptor CD. */
extern int __gconv_close (__gconv_t cd)
attribute_hidden;
-diff --git a/iconv/iconv_open.c b/iconv/iconv_open.c
-index dd54bc12e0..5b30055c04 100644
---- a/iconv/iconv_open.c
-+++ b/iconv/iconv_open.c
-@@ -39,7 +39,7 @@ iconv_open (const char *tocode, const char *fromcode)
+diff -pruN glibc-2.32.orig/iconv/iconv_open.c glibc-2.32/iconv/iconv_open.c
+--- glibc-2.32.orig/iconv/iconv_open.c 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/iconv_open.c 2021-09-18 21:03:05.311302253 +1000
+@@ -39,7 +39,7 @@ iconv_open (const char *tocode, const ch
int res = __gconv_open (&conv_spec, &cd, 0);
@@ -485,10 +832,9 @@ index dd54bc12e0..5b30055c04 100644
if (__builtin_expect (res, __GCONV_OK) != __GCONV_OK)
{
-diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
-index b4334faa57..d59979759c 100644
---- a/iconv/iconv_prog.c
-+++ b/iconv/iconv_prog.c
+diff -pruN glibc-2.32.orig/iconv/iconv_prog.c glibc-2.32/iconv/iconv_prog.c
+--- glibc-2.32.orig/iconv/iconv_prog.c 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/iconv_prog.c 2021-09-18 21:03:05.311302253 +1000
@@ -184,7 +184,7 @@ main (int argc, char *argv[])
/* Let's see whether we have these coded character sets. */
res = __gconv_open (&conv_spec, &cd, 0);
@@ -498,10 +844,9 @@ index b4334faa57..d59979759c 100644
if (res != __GCONV_OK)
{
-diff --git a/iconv/tst-iconv_prog.sh b/iconv/tst-iconv_prog.sh
-index 8298136b7f..d8db7b335c 100644
---- a/iconv/tst-iconv_prog.sh
-+++ b/iconv/tst-iconv_prog.sh
+diff -pruN glibc-2.32.orig/iconv/tst-iconv_prog.sh glibc-2.32/iconv/tst-iconv_prog.sh
+--- glibc-2.32.orig/iconv/tst-iconv_prog.sh 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/tst-iconv_prog.sh 2021-09-18 21:03:05.311302253 +1000
@@ -102,12 +102,16 @@ hangarray=(
"\x00\x80;-c;IBM1161;UTF-8//TRANSLIT//IGNORE"
"\x00\xdb;-c;IBM1162;UTF-8//TRANSLIT//IGNORE"
@@ -525,34 +870,23 @@ index 8298136b7f..d8db7b335c 100644
"\x00\x53;-c;IBM16804;UTF-8//TRANSLIT//IGNORE"
"\x00\x41;-c;IBM274;UTF-8//TRANSLIT//IGNORE"
"\x00\x41;-c;IBM275;UTF-8//TRANSLIT//IGNORE"
-diff --git a/iconvdata/Makefile b/iconvdata/Makefile
-index 4ec2741cdc..4eef07557e 100644
---- a/iconvdata/Makefile
-+++ b/iconvdata/Makefile
-@@ -73,7 +73,8 @@ modules.so := $(addsuffix .so, $(modules))
- ifeq (yes,$(build-shared))
- tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
- tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
-- bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4
-+ bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
-+ bug-iconv13 bug-iconv14
- ifeq ($(have-thread-library),yes)
- tests += bug-iconv3
- endif
-@@ -321,6 +322,8 @@ $(objpfx)bug-iconv10.out: $(objpfx)gconv-modules \
- $(addprefix $(objpfx),$(modules.so))
- $(objpfx)bug-iconv12.out: $(objpfx)gconv-modules \
- $(addprefix $(objpfx),$(modules.so))
-+$(objpfx)bug-iconv14.out: $(objpfx)gconv-modules \
-+ $(addprefix $(objpfx),$(modules.so))
+diff -pruN glibc-2.32.orig/iconv/Versions glibc-2.32/iconv/Versions
+--- glibc-2.32.orig/iconv/Versions 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/Versions 2021-09-18 21:03:05.311302253 +1000
+@@ -6,7 +6,9 @@ libc {
+ GLIBC_PRIVATE {
+ # functions shared with iconv program
+ __gconv_get_alias_db; __gconv_get_cache; __gconv_get_modules_db;
+- __gconv_open; __gconv_create_spec;
++
++ # functions used elsewhere in glibc
++ __gconv_open; __gconv_create_spec; __gconv_destroy_spec;
- $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
- $(addprefix $(objpfx),$(modules.so)) \
-diff --git a/iconvdata/bug-iconv13.c b/iconvdata/bug-iconv13.c
-new file mode 100644
-index 0000000000..87aaff398e
---- /dev/null
-+++ b/iconvdata/bug-iconv13.c
+ # function used by the gconv modules
+ __gconv_transliterate;
+diff -pruN glibc-2.32.orig/iconvdata/bug-iconv13.c glibc-2.32/iconvdata/bug-iconv13.c
+--- glibc-2.32.orig/iconvdata/bug-iconv13.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/iconvdata/bug-iconv13.c 2021-09-18 21:03:05.311302253 +1000
@@ -0,0 +1,53 @@
+/* bug 24973: Test EUC-KR module
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -607,11 +941,9 @@ index 0000000000..87aaff398e
+}
+
+#include <support/test-driver.c>
-diff --git a/iconvdata/bug-iconv14.c b/iconvdata/bug-iconv14.c
-new file mode 100644
-index 0000000000..902f140fa9
---- /dev/null
-+++ b/iconvdata/bug-iconv14.c
+diff -pruN glibc-2.32.orig/iconvdata/bug-iconv14.c glibc-2.32/iconvdata/bug-iconv14.c
+--- glibc-2.32.orig/iconvdata/bug-iconv14.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/iconvdata/bug-iconv14.c 2021-09-18 21:03:05.311302253 +1000
@@ -0,0 +1,127 @@
+/* Assertion in ISO-2022-JP-3 due to two-character sequence (bug 27256).
+ Copyright (C) 2021 Free Software Foundation, Inc.
@@ -740,11 +1072,10 @@ index 0000000000..902f140fa9
+}
+
+#include <support/test-driver.c>
-diff --git a/iconvdata/euc-kr.c b/iconvdata/euc-kr.c
-index b0d56cf3ee..1045bae926 100644
---- a/iconvdata/euc-kr.c
-+++ b/iconvdata/euc-kr.c
-@@ -80,11 +80,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
+diff -pruN glibc-2.32.orig/iconvdata/euc-kr.c glibc-2.32/iconvdata/euc-kr.c
+--- glibc-2.32.orig/iconvdata/euc-kr.c 2021-09-18 21:02:32.648182831 +1000
++++ glibc-2.32/iconvdata/euc-kr.c 2021-09-18 21:03:05.311302253 +1000
+@@ -80,11 +80,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned c
\
if (ch <= 0x9f) \
++inptr; \
@@ -757,10 +1088,9 @@ index b0d56cf3ee..1045bae926 100644
{ \
/* This is illegal. */ \
STANDARD_FROM_LOOP_ERR_HANDLER (1); \
-diff --git a/iconvdata/ibm1364.c b/iconvdata/ibm1364.c
-index 49e7267ab4..521f0825b7 100644
---- a/iconvdata/ibm1364.c
-+++ b/iconvdata/ibm1364.c
+diff -pruN glibc-2.32.orig/iconvdata/ibm1364.c glibc-2.32/iconvdata/ibm1364.c
+--- glibc-2.32.orig/iconvdata/ibm1364.c 2021-09-18 21:02:32.649182866 +1000
++++ glibc-2.32/iconvdata/ibm1364.c 2021-09-18 21:03:05.311302253 +1000
@@ -158,24 +158,14 @@ enum
\
if (__builtin_expect (ch, 0) == SO) \
@@ -788,10 +1118,9 @@ index 49e7267ab4..521f0825b7 100644
curcs = sb; \
++inptr; \
continue; \
-diff --git a/iconvdata/iso-2022-jp-3.c b/iconvdata/iso-2022-jp-3.c
-index 8c3b7e627e..62cbc54a11 100644
---- a/iconvdata/iso-2022-jp-3.c
-+++ b/iconvdata/iso-2022-jp-3.c
+diff -pruN glibc-2.32.orig/iconvdata/iso-2022-jp-3.c glibc-2.32/iconvdata/iso-2022-jp-3.c
+--- glibc-2.32.orig/iconvdata/iso-2022-jp-3.c 2021-09-18 21:02:32.651182934 +1000
++++ glibc-2.32/iconvdata/iso-2022-jp-3.c 2021-09-18 21:03:05.311302253 +1000
@@ -67,23 +67,34 @@ enum
CURRENT_SEL_MASK = 7 << 3
};
@@ -894,11 +1223,10 @@ index 8c3b7e627e..62cbc54a11 100644
} \
\
inptr += 2; \
-diff --git a/iconvdata/ksc5601.h b/iconvdata/ksc5601.h
-index d3eb3a4ff8..f5cdc72797 100644
---- a/iconvdata/ksc5601.h
-+++ b/iconvdata/ksc5601.h
-@@ -50,15 +50,15 @@ ksc5601_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)
+diff -pruN glibc-2.32.orig/iconvdata/ksc5601.h glibc-2.32/iconvdata/ksc5601.h
+--- glibc-2.32.orig/iconvdata/ksc5601.h 2021-09-18 21:02:32.652182968 +1000
++++ glibc-2.32/iconvdata/ksc5601.h 2021-09-18 21:03:05.311302253 +1000
+@@ -50,15 +50,15 @@ ksc5601_to_ucs4 (const unsigned char **s
unsigned char ch2;
int idx;
@@ -917,11 +1245,32 @@ index d3eb3a4ff8..f5cdc72797 100644
ch2 = (*s)[1];
if (ch2 < offset || (ch2 - offset) <= 0x20 || (ch2 - offset) >= 0x7f)
return __UNKNOWN_10646_CHAR;
-diff --git a/intl/dcigettext.c b/intl/dcigettext.c
-index 2e7c662bc7..bd332e71da 100644
---- a/intl/dcigettext.c
-+++ b/intl/dcigettext.c
-@@ -1120,15 +1120,18 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
+diff -pruN glibc-2.32.orig/iconvdata/Makefile glibc-2.32/iconvdata/Makefile
+--- glibc-2.32.orig/iconvdata/Makefile 2021-09-18 21:02:32.647182797 +1000
++++ glibc-2.32/iconvdata/Makefile 2021-09-18 21:03:05.311302253 +1000
+@@ -73,7 +73,8 @@ modules.so := $(addsuffix .so, $(modules
+ ifeq (yes,$(build-shared))
+ tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
+ tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
+- bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4
++ bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
++ bug-iconv13 bug-iconv14
+ ifeq ($(have-thread-library),yes)
+ tests += bug-iconv3
+ endif
+@@ -321,6 +322,8 @@ $(objpfx)bug-iconv10.out: $(objpfx)gconv
+ $(addprefix $(objpfx),$(modules.so))
+ $(objpfx)bug-iconv12.out: $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so))
++$(objpfx)bug-iconv14.out: $(objpfx)gconv-modules \
++ $(addprefix $(objpfx),$(modules.so))
+
+ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so)) \
+diff -pruN glibc-2.32.orig/intl/dcigettext.c glibc-2.32/intl/dcigettext.c
+--- glibc-2.32.orig/intl/dcigettext.c 2021-09-18 21:02:32.656183106 +1000
++++ glibc-2.32/intl/dcigettext.c 2021-09-18 21:03:05.311302253 +1000
+@@ -1120,15 +1120,18 @@ _nl_find_msg (struct loaded_l10nfile *do
# ifdef _LIBC
@@ -947,10 +1296,9 @@ index 2e7c662bc7..bd332e71da 100644
if (__builtin_expect (r != __GCONV_OK, 0))
{
/* If the output encoding is the same there is
-diff --git a/intl/tst-codeset.c b/intl/tst-codeset.c
-index fd70432eca..e9f6e5e09f 100644
---- a/intl/tst-codeset.c
-+++ b/intl/tst-codeset.c
+diff -pruN glibc-2.32.orig/intl/tst-codeset.c glibc-2.32/intl/tst-codeset.c
+--- glibc-2.32.orig/intl/tst-codeset.c 2021-09-18 21:02:32.656183106 +1000
++++ glibc-2.32/intl/tst-codeset.c 2021-09-18 21:03:05.311302253 +1000
@@ -22,13 +22,11 @@
#include <stdio.h>
#include <stdlib.h>
@@ -989,8 +1337,6 @@ index fd70432eca..e9f6e5e09f 100644
- printf ("call 2 returned: %s\n", s);
- result = 1;
- }
--
-- return result;
+ /* `a with umlaut' is transliterated to `ae'. */
+ bind_textdomain_codeset ("codeset", "ASCII//TRANSLIT");
+ TEST_COMPARE_STRING (gettext ("cheese"), "Kaese");
@@ -998,17 +1344,17 @@ index fd70432eca..e9f6e5e09f 100644
+ /* Transliteration also works by default even if not set. */
+ bind_textdomain_codeset ("codeset", "ASCII");
+ TEST_COMPARE_STRING (gettext ("cheese"), "Kaese");
-+
+
+- return result;
+ return 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
-diff --git a/malloc/Makefile b/malloc/Makefile
-index e22cbde22d..5093e8730e 100644
---- a/malloc/Makefile
-+++ b/malloc/Makefile
+diff -pruN glibc-2.32.orig/malloc/Makefile glibc-2.32/malloc/Makefile
+--- glibc-2.32.orig/malloc/Makefile 2021-09-18 21:02:32.670183585 +1000
++++ glibc-2.32/malloc/Makefile 2021-09-18 21:03:05.312302287 +1000
@@ -62,6 +62,16 @@ endif
tests += $(tests-static)
test-srcs = tst-mtrace
@@ -1026,7 +1372,7 @@ index e22cbde22d..5093e8730e 100644
routines = malloc morecore mcheck mtrace obstack reallocarray \
scratch_buffer_grow scratch_buffer_grow_preserve \
scratch_buffer_set_array_size \
-@@ -100,6 +110,11 @@ $(objpfx)tst-malloc-thread-exit: $(shared-thread-library)
+@@ -100,6 +110,11 @@ $(objpfx)tst-malloc-thread-exit: $(share
$(objpfx)tst-malloc-thread-fail: $(shared-thread-library)
$(objpfx)tst-malloc-fork-deadlock: $(shared-thread-library)
$(objpfx)tst-malloc-stats-cancellation: $(shared-thread-library)
@@ -1038,7 +1384,7 @@ index e22cbde22d..5093e8730e 100644
# Export the __malloc_initialize_hook variable to libc.so.
LDFLAGS-tst-mallocstate = -rdynamic
-@@ -239,6 +254,8 @@ $(tests:%=$(objpfx)%.o): CPPFLAGS += -DTEST_NO_MALLOPT
+@@ -239,6 +254,8 @@ $(tests:%=$(objpfx)%.o): CPPFLAGS += -DT
$(objpfx)tst-interpose-nothread: $(objpfx)tst-interpose-aux-nothread.o
$(objpfx)tst-interpose-thread: \
$(objpfx)tst-interpose-aux-thread.o $(shared-thread-library)
@@ -1047,18 +1393,17 @@ index e22cbde22d..5093e8730e 100644
$(objpfx)tst-interpose-static-nothread: $(objpfx)tst-interpose-aux-nothread.o
$(objpfx)tst-interpose-static-thread: \
$(objpfx)tst-interpose-aux-thread.o $(static-thread-library)
-@@ -256,3 +273,6 @@ $(objpfx)tst-dynarray-fail-mem.out: $(objpfx)tst-dynarray-fail.out
+@@ -256,3 +273,6 @@ $(objpfx)tst-dynarray-fail-mem.out: $(ob
$(objpfx)tst-malloc-tcache-leak: $(shared-thread-library)
$(objpfx)tst-malloc_info: $(shared-thread-library)
$(objpfx)tst-mallocfork2: $(shared-thread-library)
+$(objpfx)tst-malloc-tcache-leak-mcheck: $(shared-thread-library)
+$(objpfx)tst-malloc_info-mcheck: $(shared-thread-library)
+$(objpfx)tst-mallocfork2-mcheck: $(shared-thread-library)
-diff --git a/manual/tunables.texi b/manual/tunables.texi
-index 23ef0d40e7..d72d7a5ec0 100644
---- a/manual/tunables.texi
-+++ b/manual/tunables.texi
-@@ -432,7 +432,11 @@ set shared cache size in bytes for use in memory and string routines.
+diff -pruN glibc-2.32.orig/manual/tunables.texi glibc-2.32/manual/tunables.texi
+--- glibc-2.32.orig/manual/tunables.texi 2021-09-18 21:02:32.672183654 +1000
++++ glibc-2.32/manual/tunables.texi 2021-09-18 21:03:05.312302287 +1000
+@@ -432,7 +432,11 @@ set shared cache size in bytes for use i
@deftp Tunable glibc.cpu.x86_non_temporal_threshold
The @code{glibc.cpu.x86_non_temporal_threshold} tunable allows the user
@@ -1071,10 +1416,9 @@ index 23ef0d40e7..d72d7a5ec0 100644
This tunable is specific to i386 and x86-64.
@end deftp
-diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
-index 19d9cc5cfe..38221d0b2a 100644
---- a/misc/sys/cdefs.h
-+++ b/misc/sys/cdefs.h
+diff -pruN glibc-2.32.orig/misc/sys/cdefs.h glibc-2.32/misc/sys/cdefs.h
+--- glibc-2.32.orig/misc/sys/cdefs.h 2021-09-18 21:02:32.690184271 +1000
++++ glibc-2.32/misc/sys/cdefs.h 2021-09-18 21:03:05.312302287 +1000
@@ -124,13 +124,10 @@
#define __bos0(ptr) __builtin_object_size (ptr, 0)
@@ -1089,11 +1433,62 @@ index 19d9cc5cfe..38221d0b2a 100644
# define __warnattr(msg)
# define __errordecl(name, msg) extern void name (void)
#endif
-diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
-index 88c69d1e9c..381aa721ef 100644
---- a/nscd/netgroupcache.c
-+++ b/nscd/netgroupcache.c
-@@ -248,7 +248,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
+diff -pruN glibc-2.32.orig/NEWS glibc-2.32/NEWS
+--- glibc-2.32.orig/NEWS 2021-09-18 21:02:32.639182523 +1000
++++ glibc-2.32/NEWS 2021-09-18 21:30:11.284117111 +1000
+@@ -5,6 +5,33 @@ See the end for copying conditions.
+ Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
+ using `glibc' in the "product" field.
+
++The following bugs are resolved with this release:
++
++ [20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
++ [25399] Remove __warn_memset_zero_len
++ [26224] iconv hangs when converting some invalid inputs from several IBM
++ character sets (CVE-2020-27618)
++ [26534] libm.so 2.32 SIGILL in pow() due to FMA4 instruction on non-FMA4
++ system
++ [26555] string: strerrorname_np does not return the documented value
++ [26600] Transaction ID collisions cause slow DNS lookups in getaddrinfo
++ [26636] libc: 32-bit shmctl(IPC_INFO) crashes when shminfo struct is
++ at the end of a memory mapping
++ [26637] libc: semctl SEM_STAT_ANY fails to pass the buffer specified
++ by the caller to the kernel
++ [26639] libc: msgctl IPC_INFO and MSG_INFO return garbage
++ [26690] __vfscanf_internal: fix aliasing violation
++ [26853] aarch64: Missing unwind information in statically linked startup code
++ [26932] libc: sh: Multiple floating point functions defined as stubs only
++ [27024] posix: Correct attribute access mode on readlinkat
++ [27130] "rep movsb" performance issue
++ [27177] GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
++ [27256] gconv: Fix assertion failure in ISO-2022-JP-3 module
++ [27462] nscd: Fix double free in netgroupcache
++ [27471] Fix SXID_ERASE behavior in setuid programs
++ [27896] Use __pthread_attr_copy in mq_notify (CVE-2021-33574)
++ [28213] librt: fix NULL pointer dereference
++
+ Version 2.32
+
+ Major new features:
+@@ -185,6 +212,14 @@ Security related changes:
+ Dytrych of the Cisco Security Assessment and Penetration Team (See
+ TALOS-2020-1019).
+
++ CVE-2020-27618: An infinite loop has been fixed in the iconv program when
++ invoked with input containing redundant shift sequences in the IBM1364,
++ IBM1371, IBM1388, IBM1390, or IBM1399 character sets.
++
++ CVE-2021-33574: The mq_notify function has a potential use-after-free
++ issue when using a notification type of SIGEV_THREAD and a thread
++ attribute with a non-default affinity mask.
++
+ The following bugs are resolved with this release:
+
+ [9809] localedata: ckb_IQ: new Kurdish Sorani locale
+diff -pruN glibc-2.32.orig/nscd/netgroupcache.c glibc-2.32/nscd/netgroupcache.c
+--- glibc-2.32.orig/nscd/netgroupcache.c 2021-09-18 21:02:32.692184339 +1000
++++ glibc-2.32/nscd/netgroupcache.c 2021-09-18 21:03:05.312302287 +1000
+@@ -248,7 +248,7 @@ addgetnetgrentX (struct database_dyn *db
: NULL);
ndomain = (ndomain ? newbuf + ndomaindiff
: NULL);
@@ -1102,7 +1497,7 @@ index 88c69d1e9c..381aa721ef 100644
}
nhost = memcpy (buffer + bufused,
-@@ -319,7 +319,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
+@@ -319,7 +319,7 @@ addgetnetgrentX (struct database_dyn *db
else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE)
{
buflen *= 2;
@@ -1111,10 +1506,44 @@ index 88c69d1e9c..381aa721ef 100644
}
else if (status == NSS_STATUS_RETURN
|| status == NSS_STATUS_NOTFOUND
-diff --git a/resolv/Makefile b/resolv/Makefile
-index b61c0c3e0c..dbd8f8bf4f 100644
---- a/resolv/Makefile
-+++ b/resolv/Makefile
+diff -pruN glibc-2.32.orig/posix/unistd.h glibc-2.32/posix/unistd.h
+--- glibc-2.32.orig/posix/unistd.h 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/posix/unistd.h 2021-09-18 21:04:13.411636170 +1000
+@@ -831,7 +831,7 @@ extern int symlinkat (const char *__from
+ /* Like readlink but a relative PATH is interpreted relative to FD. */
+ extern ssize_t readlinkat (int __fd, const char *__restrict __path,
+ char *__restrict __buf, size_t __len)
+- __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 4));
++ __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4));
+ #endif
+
+ /* Remove the link NAME. */
+diff -pruN glibc-2.32.orig/posix/wordexp.c glibc-2.32/posix/wordexp.c
+--- glibc-2.32.orig/posix/wordexp.c 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/posix/wordexp.c 2021-09-18 21:03:05.312302287 +1000
+@@ -1399,7 +1399,7 @@ envsubst:
+ /* Is it a numeric parameter? */
+ else if (isdigit (env[0]))
+ {
+- int n = atoi (env);
++ unsigned long n = strtoul (env, NULL, 10);
+
+ if (n >= __libc_argc)
+ /* Substitute NULL. */
+diff -pruN glibc-2.32.orig/posix/wordexp-test.c glibc-2.32/posix/wordexp-test.c
+--- glibc-2.32.orig/posix/wordexp-test.c 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/posix/wordexp-test.c 2021-09-18 21:03:05.312302287 +1000
+@@ -183,6 +183,7 @@ struct test_case_struct
+ { 0, NULL, "$var", 0, 0, { NULL, }, IFS },
+ { 0, NULL, "\"\\n\"", 0, 1, { "\\n", }, IFS },
+ { 0, NULL, "", 0, 0, { NULL, }, IFS },
++ { 0, NULL, "${1234567890123456789012}", 0, 0, { NULL, }, IFS },
+
+ /* Flags not already covered (testit() has special handling for these) */
+ { 0, NULL, "one two", WRDE_DOOFFS, 2, { "one", "two", }, IFS },
+diff -pruN glibc-2.32.orig/resolv/Makefile glibc-2.32/resolv/Makefile
+--- glibc-2.32.orig/resolv/Makefile 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/resolv/Makefile 2021-09-18 21:03:05.312302287 +1000
@@ -61,6 +61,11 @@ tests += \
tst-resolv-search \
tst-resolv-trailing \
@@ -1127,7 +1556,7 @@ index b61c0c3e0c..dbd8f8bf4f 100644
# These tests need libdl.
ifeq (yes,$(build-shared))
tests += \
-@@ -191,6 +196,8 @@ $(objpfx)tst-resolv-search: $(objpfx)libresolv.so $(shared-thread-library)
+@@ -191,6 +196,8 @@ $(objpfx)tst-resolv-search: $(objpfx)lib
$(objpfx)tst-resolv-trailing: $(objpfx)libresolv.so $(shared-thread-library)
$(objpfx)tst-resolv-threads: \
$(libdl) $(objpfx)libresolv.so $(shared-thread-library)
@@ -1136,10 +1565,9 @@ index b61c0c3e0c..dbd8f8bf4f 100644
$(objpfx)tst-resolv-canonname: \
$(libdl) $(objpfx)libresolv.so $(shared-thread-library)
$(objpfx)tst-resolv-trustad: $(objpfx)libresolv.so $(shared-thread-library)
-diff --git a/resolv/res_send.c b/resolv/res_send.c
-index 7e5fec6646..70e5066031 100644
---- a/resolv/res_send.c
-+++ b/resolv/res_send.c
+diff -pruN glibc-2.32.orig/resolv/res_send.c glibc-2.32/resolv/res_send.c
+--- glibc-2.32.orig/resolv/res_send.c 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/resolv/res_send.c 2021-09-18 21:03:05.312302287 +1000
@@ -1342,15 +1342,6 @@ send_dg(res_state statp,
*terrno = EMSGSIZE;
return close_and_return_error (statp, resplen2);
@@ -1208,11 +1636,9 @@ index 7e5fec6646..70e5066031 100644
recvresp1 = 1;
else
recvresp2 = 1;
-diff --git a/resolv/tst-resolv-txnid-collision.c b/resolv/tst-resolv-txnid-collision.c
-new file mode 100644
-index 0000000000..189b76f126
---- /dev/null
-+++ b/resolv/tst-resolv-txnid-collision.c
+diff -pruN glibc-2.32.orig/resolv/tst-resolv-txnid-collision.c glibc-2.32/resolv/tst-resolv-txnid-collision.c
+--- glibc-2.32.orig/resolv/tst-resolv-txnid-collision.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/resolv/tst-resolv-txnid-collision.c 2021-09-18 21:03:05.312302287 +1000
@@ -0,0 +1,334 @@
+/* Test parallel queries with transaction ID collisions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -1548,24 +1974,73 @@ index 0000000000..189b76f126
+}
+
+#include <support/test-driver.c>
-diff --git a/stdio-common/Makefile b/stdio-common/Makefile
-index 8475fd1f09..eff0c98d82 100644
---- a/stdio-common/Makefile
-+++ b/stdio-common/Makefile
-@@ -69,7 +69,8 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
- tst-printf-bz25691 \
- tst-vfprintf-width-prec-alloc \
- tst-printf-fp-free \
-- tst-printf-fp-leak
-+ tst-printf-fp-leak \
-+ test-strerr
+diff -pruN glibc-2.32.orig/Rules glibc-2.32/Rules
+--- glibc-2.32.orig/Rules 2021-09-18 21:02:32.639182523 +1000
++++ glibc-2.32/Rules 2021-09-18 21:03:05.310302219 +1000
+@@ -155,6 +155,7 @@ xtests: tests $(xtests-special)
+ else
+ tests: $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \
+ $(tests-container:%=$(objpfx)%.out) \
++ $(tests-mcheck:%=$(objpfx)%-mcheck.out) \
+ $(tests-special) $(tests-printers-out)
+ xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-special)
+ endif
+@@ -165,7 +166,7 @@ ifeq ($(run-built-tests),no)
+ tests-expected =
+ else
+ tests-expected = $(tests) $(tests-internal) $(tests-printers) \
+- $(tests-container)
++ $(tests-container) $(tests-mcheck:%=%-mcheck)
+ endif
+ tests:
+ $(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
+@@ -191,6 +192,7 @@ else
+ binaries-pie-tests =
+ binaries-pie-notests =
+ endif
++binaries-mcheck-tests = $(tests-mcheck:%=%-mcheck)
+ else
+ binaries-all-notests =
+ binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs)
+@@ -200,6 +202,7 @@ binaries-static-tests =
+ binaries-static =
+ binaries-pie-tests =
+ binaries-pie-notests =
++binaries-mcheck-tests =
+ endif
+ binaries-pie = $(binaries-pie-tests) $(binaries-pie-notests)
+@@ -223,6 +226,14 @@ $(addprefix $(objpfx),$(binaries-shared-
+ $(+link-tests)
+ endif
- test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble
-diff --git a/stdio-common/errlist.c b/stdio-common/errlist.c
-index d15f13a22a..2ecf121674 100644
---- a/stdio-common/errlist.c
-+++ b/stdio-common/errlist.c
++ifneq "$(strip $(binaries-mcheck-tests))" ""
++$(addprefix $(objpfx),$(binaries-mcheck-tests)): %-mcheck: %.o \
++ $(link-extra-libs-tests) \
++ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
++ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
++ $(+link-tests)
++endif
++
+ ifneq "$(strip $(binaries-pie-tests))" ""
+ $(addprefix $(objpfx),$(binaries-pie-tests)): %: %.o \
+ $(link-extra-libs-tests) \
+@@ -253,6 +264,12 @@ $(addprefix $(objpfx),$(binaries-static-
+ $(+link-static-tests)
+ endif
+
++# All mcheck tests will be run with MALLOC_CHECK_=3
++define mcheck-ENVS
++$(1)-mcheck-ENV = MALLOC_CHECK_=3
++endef
++$(foreach t,$(tests-mcheck),$(eval $(call mcheck-ENVS,$(t))))
++
+ ifneq "$(strip $(tests) $(tests-internal) $(xtests) $(test-srcs))" ""
+ # These are the implicit rules for making test outputs
+ # from the test programs and whatever input files are present.
+diff -pruN glibc-2.32.orig/stdio-common/errlist.c glibc-2.32/stdio-common/errlist.c
+--- glibc-2.32.orig/stdio-common/errlist.c 2021-09-18 21:02:32.698184545 +1000
++++ glibc-2.32/stdio-common/errlist.c 2021-09-18 21:03:05.312302287 +1000
@@ -20,9 +20,13 @@
#include <libintl.h>
#include <array_length.h>
@@ -1606,10 +2081,22 @@ index d15f13a22a..2ecf121674 100644
#include <errlist.h>
#undef _S
};
-diff --git a/stdio-common/test-strerr.c b/stdio-common/test-strerr.c
-index fded208118..d77b81d507 100644
---- a/stdio-common/test-strerr.c
-+++ b/stdio-common/test-strerr.c
+diff -pruN glibc-2.32.orig/stdio-common/Makefile glibc-2.32/stdio-common/Makefile
+--- glibc-2.32.orig/stdio-common/Makefile 2021-09-18 21:02:32.698184545 +1000
++++ glibc-2.32/stdio-common/Makefile 2021-09-18 21:03:05.312302287 +1000
+@@ -69,7 +69,8 @@ tests := tstscanf test_rdwr test-popen t
+ tst-printf-bz25691 \
+ tst-vfprintf-width-prec-alloc \
+ tst-printf-fp-free \
+- tst-printf-fp-leak
++ tst-printf-fp-leak \
++ test-strerr
+
+
+ test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble
+diff -pruN glibc-2.32.orig/stdio-common/test-strerr.c glibc-2.32/stdio-common/test-strerr.c
+--- glibc-2.32.orig/stdio-common/test-strerr.c 2021-09-18 21:02:32.698184545 +1000
++++ glibc-2.32/stdio-common/test-strerr.c 2021-09-18 21:03:05.312302287 +1000
@@ -18,46 +18,672 @@
#include <string.h>
@@ -2315,11 +2802,10 @@ index fded208118..d77b81d507 100644
return 0;
}
-diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c
-index 95b46dcbeb..3a323547f9 100644
---- a/stdio-common/vfscanf-internal.c
-+++ b/stdio-common/vfscanf-internal.c
-@@ -277,7 +277,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+diff -pruN glibc-2.32.orig/stdio-common/vfscanf-internal.c glibc-2.32/stdio-common/vfscanf-internal.c
+--- glibc-2.32.orig/stdio-common/vfscanf-internal.c 2021-09-18 21:02:32.699184579 +1000
++++ glibc-2.32/stdio-common/vfscanf-internal.c 2021-09-18 21:03:05.312302287 +1000
+@@ -277,7 +277,7 @@ __vfscanf_internal (FILE *s, const char
#endif
{
va_list arg;
@@ -2328,7 +2814,7 @@ index 95b46dcbeb..3a323547f9 100644
UCHAR_T fc; /* Current character of the format. */
WINT_T done = 0; /* Assignments done. */
size_t read_in = 0; /* Chars read in. */
-@@ -415,10 +415,11 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -415,10 +415,11 @@ __vfscanf_internal (FILE *s, const char
#endif
#ifndef COMPILE_WSCANF
@@ -2342,7 +2828,7 @@ index 95b46dcbeb..3a323547f9 100644
if (len > 0)
{
do
-@@ -426,7 +427,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -426,7 +427,7 @@ __vfscanf_internal (FILE *s, const char
c = inchar ();
if (__glibc_unlikely (c == EOF))
input_error ();
@@ -2351,48 +2837,276 @@ index 95b46dcbeb..3a323547f9 100644
{
ungetc_not_eof (c, s);
conv_error ();
-@@ -484,9 +485,9 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -484,9 +485,9 @@ __vfscanf_internal (FILE *s, const char
char_buffer_rewind (&charbuf);
- /* Check for a positional parameter specification. */
-- if (ISDIGIT ((UCHAR_T) *f))
-+ if (ISDIGIT (*f))
- {
-- argpos = read_int ((const UCHAR_T **) &f);
-+ argpos = read_int (&f);
- if (*f == L_('$'))
- ++f;
- else
-@@ -521,8 +522,8 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+ /* Check for a positional parameter specification. */
+- if (ISDIGIT ((UCHAR_T) *f))
++ if (ISDIGIT (*f))
+ {
+- argpos = read_int ((const UCHAR_T **) &f);
++ argpos = read_int (&f);
+ if (*f == L_('$'))
+ ++f;
+ else
+@@ -521,8 +522,8 @@ __vfscanf_internal (FILE *s, const char
+
+ /* Find the maximum field width. */
+ width = 0;
+- if (ISDIGIT ((UCHAR_T) *f))
+- width = read_int ((const UCHAR_T **) &f);
++ if (ISDIGIT (*f))
++ width = read_int (&f);
+ got_width:
+ if (width == 0)
+ width = -1;
+@@ -2522,12 +2523,11 @@ __vfscanf_internal (FILE *s, const char
+ }
+
+ while ((fc = *f++) != '\0' && fc != ']')
+- if (fc == '-' && *f != '\0' && *f != ']'
+- && (unsigned char) f[-2] <= (unsigned char) *f)
++ if (fc == '-' && *f != '\0' && *f != ']' && f[-2] <= *f)
+ {
+ /* Add all characters from the one before the '-'
+ up to (but not including) the next format char. */
+- for (fc = (unsigned char) f[-2]; fc < (unsigned char) *f; ++fc)
++ for (fc = f[-2]; fc < *f; ++fc)
+ ((char *)charbuf.scratch.data)[fc] = 1;
+ }
+ else
+diff -pruN glibc-2.32.orig/stdlib/tst-secure-getenv.c glibc-2.32/stdlib/tst-secure-getenv.c
+--- glibc-2.32.orig/stdlib/tst-secure-getenv.c 2021-09-18 21:02:32.700184614 +1000
++++ glibc-2.32/stdlib/tst-secure-getenv.c 2021-09-18 21:03:05.312302287 +1000
+@@ -30,167 +30,12 @@
+ #include <sys/wait.h>
+ #include <unistd.h>
+
++#include <support/check.h>
+ #include <support/support.h>
++#include <support/capture_subprocess.h>
+ #include <support/test-driver.h>
+
+ static char MAGIC_ARGUMENT[] = "run-actual-test";
+-#define MAGIC_STATUS 19
+-
+-/* Return a GID which is not our current GID, but is present in the
+- supplementary group list. */
+-static gid_t
+-choose_gid (void)
+-{
+- int count = getgroups (0, NULL);
+- if (count < 0)
+- {
+- printf ("getgroups: %m\n");
+- exit (1);
+- }
+- gid_t *groups;
+- groups = xcalloc (count, sizeof (*groups));
+- int ret = getgroups (count, groups);
+- if (ret < 0)
+- {
+- printf ("getgroups: %m\n");
+- exit (1);
+- }
+- gid_t current = getgid ();
+- gid_t not_current = 0;
+- for (int i = 0; i < ret; ++i)
+- {
+- if (groups[i] != current)
+- {
+- not_current = groups[i];
+- break;
+- }
+- }
+- free (groups);
+- return not_current;
+-}
+-
+-
+-/* Copies the executable into a restricted directory, so that we can
+- safely make it SGID with the TARGET group ID. Then runs the
+- executable. */
+-static int
+-run_executable_sgid (gid_t target)
+-{
+- char *dirname = xasprintf ("%s/secure-getenv.%jd",
+- test_dir, (intmax_t) getpid ());
+- char *execname = xasprintf ("%s/bin", dirname);
+- int infd = -1;
+- int outfd = -1;
+- int ret = -1;
+- if (mkdir (dirname, 0700) < 0)
+- {
+- printf ("mkdir: %m\n");
+- goto err;
+- }
+- infd = open ("/proc/self/exe", O_RDONLY);
+- if (infd < 0)
+- {
+- printf ("open (/proc/self/exe): %m\n");
+- goto err;
+- }
+- outfd = open (execname, O_WRONLY | O_CREAT | O_EXCL, 0700);
+- if (outfd < 0)
+- {
+- printf ("open (%s): %m\n", execname);
+- goto err;
+- }
+- char buf[4096];
+- for (;;)
+- {
+- ssize_t rdcount = read (infd, buf, sizeof (buf));
+- if (rdcount < 0)
+- {
+- printf ("read: %m\n");
+- goto err;
+- }
+- if (rdcount == 0)
+- break;
+- char *p = buf;
+- char *end = buf + rdcount;
+- while (p != end)
+- {
+- ssize_t wrcount = write (outfd, buf, end - p);
+- if (wrcount == 0)
+- errno = ENOSPC;
+- if (wrcount <= 0)
+- {
+- printf ("write: %m\n");
+- goto err;
+- }
+- p += wrcount;
+- }
+- }
+- if (fchown (outfd, getuid (), target) < 0)
+- {
+- printf ("fchown (%s): %m\n", execname);
+- goto err;
+- }
+- if (fchmod (outfd, 02750) < 0)
+- {
+- printf ("fchmod (%s): %m\n", execname);
+- goto err;
+- }
+- if (close (outfd) < 0)
+- {
+- printf ("close (outfd): %m\n");
+- goto err;
+- }
+- if (close (infd) < 0)
+- {
+- printf ("close (infd): %m\n");
+- goto err;
+- }
+-
+- int kid = fork ();
+- if (kid < 0)
+- {
+- printf ("fork: %m\n");
+- goto err;
+- }
+- if (kid == 0)
+- {
+- /* Child process. */
+- char *args[] = { execname, MAGIC_ARGUMENT, NULL };
+- execve (execname, args, environ);
+- printf ("execve (%s): %m\n", execname);
+- _exit (1);
+- }
+- int status;
+- if (waitpid (kid, &status, 0) < 0)
+- {
+- printf ("waitpid: %m\n");
+- goto err;
+- }
+- if (!WIFEXITED (status) || WEXITSTATUS (status) != MAGIC_STATUS)
+- {
+- printf ("Unexpected exit status %d from child process\n",
+- status);
+- goto err;
+- }
+- ret = 0;
+-
+-err:
+- if (outfd >= 0)
+- close (outfd);
+- if (infd >= 0)
+- close (infd);
+- if (execname)
+- {
+- unlink (execname);
+- free (execname);
+- }
+- if (dirname)
+- {
+- rmdir (dirname);
+- free (dirname);
+- }
+- return ret;
+-}
+
+ static int
+ do_test (void)
+@@ -212,15 +57,15 @@ do_test (void)
+ exit (1);
+ }
+
+- gid_t target = choose_gid ();
+- if (target == 0)
+- {
+- fprintf (stderr,
+- "Could not find a suitable GID for user %jd, skipping test\n",
+- (intmax_t) getuid ());
+- exit (0);
+- }
+- return run_executable_sgid (target);
++ int status = support_capture_subprogram_self_sgid (MAGIC_ARGUMENT);
++
++ if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
++ return EXIT_UNSUPPORTED;
++
++ if (!WIFEXITED (status))
++ FAIL_EXIT1 ("Unexpected exit status %d from child process\n", status);
++
++ return 0;
+ }
- /* Find the maximum field width. */
- width = 0;
-- if (ISDIGIT ((UCHAR_T) *f))
-- width = read_int ((const UCHAR_T **) &f);
-+ if (ISDIGIT (*f))
-+ width = read_int (&f);
- got_width:
- if (width == 0)
- width = -1;
-@@ -2522,12 +2523,11 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
- }
+ static void
+@@ -229,23 +74,15 @@ alternative_main (int argc, char **argv)
+ if (argc == 2 && strcmp (argv[1], MAGIC_ARGUMENT) == 0)
+ {
+ if (getgid () == getegid ())
+- {
+- /* This can happen if the file system is mounted nosuid. */
+- fprintf (stderr, "SGID failed: GID and EGID match (%jd)\n",
+- (intmax_t) getgid ());
+- exit (MAGIC_STATUS);
+- }
++ /* This can happen if the file system is mounted nosuid. */
++ FAIL_UNSUPPORTED ("SGID failed: GID and EGID match (%jd)\n",
++ (intmax_t) getgid ());
+ if (getenv ("PATH") == NULL)
+- {
+- printf ("PATH variable not present\n");
+- exit (3);
+- }
++ FAIL_EXIT (3, "PATH variable not present\n");
+ if (secure_getenv ("PATH") != NULL)
+- {
+- printf ("PATH variable not filtered out\n");
+- exit (4);
+- }
+- exit (MAGIC_STATUS);
++ FAIL_EXIT (4, "PATH variable not filtered out\n");
++
++ exit (EXIT_SUCCESS);
+ }
+ }
- while ((fc = *f++) != '\0' && fc != ']')
-- if (fc == '-' && *f != '\0' && *f != ']'
-- && (unsigned char) f[-2] <= (unsigned char) *f)
-+ if (fc == '-' && *f != '\0' && *f != ']' && f[-2] <= *f)
- {
- /* Add all characters from the one before the '-'
- up to (but not including) the next format char. */
-- for (fc = (unsigned char) f[-2]; fc < (unsigned char) *f; ++fc)
-+ for (fc = f[-2]; fc < *f; ++fc)
- ((char *)charbuf.scratch.data)[fc] = 1;
- }
- else
-diff --git a/string/bits/string_fortified.h b/string/bits/string_fortified.h
-index 309d0f39b2..c8d3051af8 100644
---- a/string/bits/string_fortified.h
-+++ b/string/bits/string_fortified.h
+diff -pruN glibc-2.32.orig/string/bits/string_fortified.h glibc-2.32/string/bits/string_fortified.h
+--- glibc-2.32.orig/string/bits/string_fortified.h 2021-09-18 21:02:32.700184614 +1000
++++ glibc-2.32/string/bits/string_fortified.h 2021-09-18 21:03:05.312302287 +1000
@@ -22,11 +22,6 @@
# error "Never use <bits/string_fortified.h> directly; include <string.h> instead."
#endif
@@ -2405,7 +3119,7 @@ index 309d0f39b2..c8d3051af8 100644
__fortify_function void *
__NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __len))
-@@ -58,16 +53,6 @@ __NTH (mempcpy (void *__restrict __dest, const void *__restrict __src,
+@@ -58,16 +53,6 @@ __NTH (mempcpy (void *__restrict __dest,
__fortify_function void *
__NTH (memset (void *__dest, int __ch, size_t __len))
{
@@ -2422,10 +3136,25 @@ index 309d0f39b2..c8d3051af8 100644
return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
}
-diff --git a/support/Makefile b/support/Makefile
-index 93faafddf9..4154863511 100644
---- a/support/Makefile
-+++ b/support/Makefile
+diff -pruN glibc-2.32.orig/support/capture_subprocess.h glibc-2.32/support/capture_subprocess.h
+--- glibc-2.32.orig/support/capture_subprocess.h 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/capture_subprocess.h 2021-09-18 21:03:05.312302287 +1000
+@@ -41,6 +41,12 @@ struct support_capture_subprocess suppor
+ struct support_capture_subprocess support_capture_subprogram
+ (const char *file, char *const argv[]);
+
++/* Copy the running program into a setgid binary and run it with CHILD_ID
++ argument. If execution is successful, return the exit status of the child
++ program, otherwise return a non-zero failure exit code. */
++int support_capture_subprogram_self_sgid
++ (char *child_id);
++
+ /* Deallocate the subprocess data captured by
+ support_capture_subprocess. */
+ void support_capture_subprocess_free (struct support_capture_subprocess *);
+diff -pruN glibc-2.32.orig/support/Makefile glibc-2.32/support/Makefile
+--- glibc-2.32.orig/support/Makefile 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/Makefile 2021-09-18 21:03:05.312302287 +1000
@@ -35,6 +35,8 @@ libsupport-routines = \
ignore_stderr \
next_to_fault \
@@ -2435,11 +3164,9 @@ index 93faafddf9..4154863511 100644
resolv_test \
set_fortify_handler \
support-xfstat \
-diff --git a/support/resolv_response_context_duplicate.c b/support/resolv_response_context_duplicate.c
-new file mode 100644
-index 0000000000..f9c5c3462a
---- /dev/null
-+++ b/support/resolv_response_context_duplicate.c
+diff -pruN glibc-2.32.orig/support/resolv_response_context_duplicate.c glibc-2.32/support/resolv_response_context_duplicate.c
+--- glibc-2.32.orig/support/resolv_response_context_duplicate.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/support/resolv_response_context_duplicate.c 2021-09-18 21:03:05.312302287 +1000
@@ -0,0 +1,37 @@
+/* Duplicate a response context used in DNS resolver tests.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -2478,11 +3205,9 @@ index 0000000000..f9c5c3462a
+ memcpy (result->query_buffer, ctx->query_buffer, result->query_length);
+ return result;
+}
-diff --git a/support/resolv_response_context_free.c b/support/resolv_response_context_free.c
-new file mode 100644
-index 0000000000..b88c05ffd4
---- /dev/null
-+++ b/support/resolv_response_context_free.c
+diff -pruN glibc-2.32.orig/support/resolv_response_context_free.c glibc-2.32/support/resolv_response_context_free.c
+--- glibc-2.32.orig/support/resolv_response_context_free.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/support/resolv_response_context_free.c 2021-09-18 21:03:05.312302287 +1000
@@ -0,0 +1,28 @@
+/* Free a response context used in DNS resolver tests.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -2512,11 +3237,10 @@ index 0000000000..b88c05ffd4
+ free (ctx->client_address);
+ free (ctx);
+}
-diff --git a/support/resolv_test.c b/support/resolv_test.c
-index 53b7fc41ab..9878a040a3 100644
---- a/support/resolv_test.c
-+++ b/support/resolv_test.c
-@@ -181,7 +181,9 @@ resolv_response_init (struct resolv_response_builder *b,
+diff -pruN glibc-2.32.orig/support/resolv_test.c glibc-2.32/support/resolv_test.c
+--- glibc-2.32.orig/support/resolv_test.c 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/resolv_test.c 2021-09-18 21:03:05.312302287 +1000
+@@ -181,7 +181,9 @@ resolv_response_init (struct resolv_resp
b->buffer[2] |= b->query_buffer[2] & 0x01; /* Copy the RD bit. */
if (flags.tc)
b->buffer[2] |= 0x02;
@@ -2527,7 +3251,7 @@ index 53b7fc41ab..9878a040a3 100644
if (flags.ad)
b->buffer[3] |= 0x20;
-@@ -434,9 +436,9 @@ resolv_response_buffer (const struct resolv_response_builder *b)
+@@ -434,9 +436,9 @@ resolv_response_buffer (const struct res
return result;
}
@@ -2551,7 +3275,7 @@ index 53b7fc41ab..9878a040a3 100644
{
tdestroy (b->compression_offsets, free);
free (b);
-@@ -661,13 +663,17 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
+@@ -661,13 +663,17 @@ server_thread_udp_process_one (struct re
struct resolv_response_context ctx =
{
@@ -2570,7 +3294,7 @@ index 53b7fc41ab..9878a040a3 100644
obj->config.response_callback
(&ctx, b, qinfo.qname, qinfo.qclass, qinfo.qtype);
-@@ -684,7 +690,7 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
+@@ -684,7 +690,7 @@ server_thread_udp_process_one (struct re
if (b->offset >= 12)
printf ("info: UDP server %d: sending response:"
" %zu bytes, RCODE %d (for %s/%u/%u)\n",
@@ -2579,7 +3303,7 @@ index 53b7fc41ab..9878a040a3 100644
qinfo.qname, qinfo.qclass, qinfo.qtype);
else
printf ("info: UDP server %d: sending response: %zu bytes"
-@@ -694,23 +700,31 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
+@@ -694,23 +700,31 @@ server_thread_udp_process_one (struct re
if (b->truncate_bytes > 0)
printf ("info: truncated by %u bytes\n", b->truncate_bytes);
}
@@ -2651,10 +3375,9 @@ index 53b7fc41ab..9878a040a3 100644
free (query_buffer);
if (close_flag)
break;
-diff --git a/support/resolv_test.h b/support/resolv_test.h
-index 67819469a0..31a5c1c3e7 100644
---- a/support/resolv_test.h
-+++ b/support/resolv_test.h
+diff -pruN glibc-2.32.orig/support/resolv_test.h glibc-2.32/support/resolv_test.h
+--- glibc-2.32.orig/support/resolv_test.h 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/resolv_test.h 2021-09-18 21:03:05.312302287 +1000
@@ -35,25 +35,36 @@ struct resolv_edns_info
uint16_t payload_size;
};
@@ -2708,7 +3431,7 @@ index 67819469a0..31a5c1c3e7 100644
/* Initial section count values. Can be used to artificially
increase the counts, for malformed packet testing.*/
unsigned short qdcount;
-@@ -188,6 +203,22 @@ void resolv_response_close (struct resolv_response_builder *);
+@@ -188,6 +203,22 @@ void resolv_response_close (struct resol
/* The size of the response packet built so far. */
size_t resolv_response_length (const struct resolv_response_builder *);
@@ -2731,10 +3454,240 @@ index 67819469a0..31a5c1c3e7 100644
__END_DECLS
#endif /* SUPPORT_RESOLV_TEST_H */
-diff --git a/sysdeps/aarch64/dl-bti.c b/sysdeps/aarch64/dl-bti.c
-index 196e462520..cf7624aaa2 100644
---- a/sysdeps/aarch64/dl-bti.c
-+++ b/sysdeps/aarch64/dl-bti.c
+diff -pruN glibc-2.32.orig/support/subprocess.h glibc-2.32/support/subprocess.h
+--- glibc-2.32.orig/support/subprocess.h 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/subprocess.h 2021-09-18 21:03:05.312302287 +1000
+@@ -38,6 +38,11 @@ struct support_subprocess support_subpro
+ struct support_subprocess support_subprogram
+ (const char *file, char *const argv[]);
+
++/* Invoke program FILE with ARGV arguments by using posix_spawn and wait for it
++ to complete. Return program exit status. */
++int support_subprogram_wait
++ (const char *file, char *const argv[]);
++
+ /* Wait for the subprocess indicated by PROC::PID. Return the status
+ indicate by waitpid call. */
+ int support_process_wait (struct support_subprocess *proc);
+diff -pruN glibc-2.32.orig/support/support_capture_subprocess.c glibc-2.32/support/support_capture_subprocess.c
+--- glibc-2.32.orig/support/support_capture_subprocess.c 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/support_capture_subprocess.c 2021-09-18 21:03:05.313302322 +1000
+@@ -20,11 +20,14 @@
+ #include <support/capture_subprocess.h>
+
+ #include <errno.h>
++#include <fcntl.h>
+ #include <stdlib.h>
+ #include <support/check.h>
+ #include <support/xunistd.h>
+ #include <support/xsocket.h>
+ #include <support/xspawn.h>
++#include <support/support.h>
++#include <support/test-driver.h>
+
+ static void
+ transfer (const char *what, struct pollfd *pfd, struct xmemstream *stream)
+@@ -36,7 +39,7 @@ transfer (const char *what, struct pollf
+ if (ret < 0)
+ {
+ support_record_failure ();
+- printf ("error: reading from subprocess %s: %m", what);
++ printf ("error: reading from subprocess %s: %m\n", what);
+ pfd->events = 0;
+ pfd->revents = 0;
+ }
+@@ -102,6 +105,129 @@ support_capture_subprogram (const char *
+ return result;
+ }
+
++/* Copies the executable into a restricted directory, so that we can
++ safely make it SGID with the TARGET group ID. Then runs the
++ executable. */
++static int
++copy_and_spawn_sgid (char *child_id, gid_t gid)
++{
++ char *dirname = xasprintf ("%s/tst-tunables-setuid.%jd",
++ test_dir, (intmax_t) getpid ());
++ char *execname = xasprintf ("%s/bin", dirname);
++ int infd = -1;
++ int outfd = -1;
++ int ret = 1, status = 1;
++
++ TEST_VERIFY (mkdir (dirname, 0700) == 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++
++ infd = open ("/proc/self/exe", O_RDONLY);
++ if (infd < 0)
++ FAIL_UNSUPPORTED ("unsupported: Cannot read binary from procfs\n");
++
++ outfd = open (execname, O_WRONLY | O_CREAT | O_EXCL, 0700);
++ TEST_VERIFY (outfd >= 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++
++ char buf[4096];
++ for (;;)
++ {
++ ssize_t rdcount = read (infd, buf, sizeof (buf));
++ TEST_VERIFY (rdcount >= 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++ if (rdcount == 0)
++ break;
++ char *p = buf;
++ char *end = buf + rdcount;
++ while (p != end)
++ {
++ ssize_t wrcount = write (outfd, buf, end - p);
++ if (wrcount == 0)
++ errno = ENOSPC;
++ TEST_VERIFY (wrcount > 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++ p += wrcount;
++ }
++ }
++ TEST_VERIFY (fchown (outfd, getuid (), gid) == 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++ TEST_VERIFY (fchmod (outfd, 02750) == 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++ TEST_VERIFY (close (outfd) == 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++ TEST_VERIFY (close (infd) == 0);
++ if (support_record_failure_is_failed ())
++ goto err;
++
++ /* We have the binary, now spawn the subprocess. Avoid using
++ support_subprogram because we only want the program exit status, not the
++ contents. */
++ ret = 0;
++
++ char * const args[] = {execname, child_id, NULL};
++
++ status = support_subprogram_wait (args[0], args);
++
++err:
++ if (outfd >= 0)
++ close (outfd);
++ if (infd >= 0)
++ close (infd);
++ if (execname != NULL)
++ {
++ unlink (execname);
++ free (execname);
++ }
++ if (dirname != NULL)
++ {
++ rmdir (dirname);
++ free (dirname);
++ }
++
++ if (ret != 0)
++ FAIL_EXIT1("Failed to make sgid executable for test\n");
++
++ return status;
++}
++
++int
++support_capture_subprogram_self_sgid (char *child_id)
++{
++ gid_t target = 0;
++ const int count = 64;
++ gid_t groups[count];
++
++ /* Get a GID which is not our current GID, but is present in the
++ supplementary group list. */
++ int ret = getgroups (count, groups);
++ if (ret < 0)
++ FAIL_UNSUPPORTED("Could not get group list for user %jd\n",
++ (intmax_t) getuid ());
++
++ gid_t current = getgid ();
++ for (int i = 0; i < ret; ++i)
++ {
++ if (groups[i] != current)
++ {
++ target = groups[i];
++ break;
++ }
++ }
++
++ if (target == 0)
++ FAIL_UNSUPPORTED("Could not find a suitable GID for user %jd\n",
++ (intmax_t) getuid ());
++
++ return copy_and_spawn_sgid (child_id, target);
++}
++
+ void
+ support_capture_subprocess_free (struct support_capture_subprocess *p)
+ {
+diff -pruN glibc-2.32.orig/support/support_subprocess.c glibc-2.32/support/support_subprocess.c
+--- glibc-2.32.orig/support/support_subprocess.c 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/support_subprocess.c 2021-09-18 21:03:05.313302322 +1000
+@@ -27,7 +27,7 @@
+ #include <support/subprocess.h>
+
+ static struct support_subprocess
+-support_suprocess_init (void)
++support_subprocess_init (void)
+ {
+ struct support_subprocess result;
+
+@@ -48,7 +48,7 @@ support_suprocess_init (void)
+ struct support_subprocess
+ support_subprocess (void (*callback) (void *), void *closure)
+ {
+- struct support_subprocess result = support_suprocess_init ();
++ struct support_subprocess result = support_subprocess_init ();
+
+ result.pid = xfork ();
+ if (result.pid == 0)
+@@ -71,7 +71,7 @@ support_subprocess (void (*callback) (vo
+ struct support_subprocess
+ support_subprogram (const char *file, char *const argv[])
+ {
+- struct support_subprocess result = support_suprocess_init ();
++ struct support_subprocess result = support_subprocess_init ();
+
+ posix_spawn_file_actions_t fa;
+ /* posix_spawn_file_actions_init does not fail. */
+@@ -84,7 +84,7 @@ support_subprogram (const char *file, ch
+ xposix_spawn_file_actions_addclose (&fa, result.stdout_pipe[1]);
+ xposix_spawn_file_actions_addclose (&fa, result.stderr_pipe[1]);
+
+- result.pid = xposix_spawn (file, &fa, NULL, argv, NULL);
++ result.pid = xposix_spawn (file, &fa, NULL, argv, environ);
+
+ xclose (result.stdout_pipe[1]);
+ xclose (result.stderr_pipe[1]);
+@@ -93,6 +93,19 @@ support_subprogram (const char *file, ch
+ }
+
+ int
++support_subprogram_wait (const char *file, char *const argv[])
++{
++ posix_spawn_file_actions_t fa;
++
++ posix_spawn_file_actions_init (&fa);
++ struct support_subprocess res = support_subprocess_init ();
++
++ res.pid = xposix_spawn (file, &fa, NULL, argv, environ);
++
++ return support_process_wait (&res);
++}
++
++int
+ support_process_wait (struct support_subprocess *proc)
+ {
+ xclose (proc->stdout_pipe[0]);
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/dl-bti.c glibc-2.32/sysdeps/aarch64/dl-bti.c
+--- glibc-2.32.orig/sysdeps/aarch64/dl-bti.c 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/dl-bti.c 2021-09-18 21:03:05.313302322 +1000
@@ -19,43 +19,76 @@
#include <errno.h>
#include <libintl.h>
@@ -2831,11 +3784,10 @@ index 196e462520..cf7624aaa2 100644
+ bti_failed (dep, program);
+ }
}
-diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
-index 70b9ed3925..fde7cfd9e2 100644
---- a/sysdeps/aarch64/dl-machine.h
-+++ b/sysdeps/aarch64/dl-machine.h
-@@ -395,13 +395,6 @@ elf_machine_lazy_rel (struct link_map *map,
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/dl-machine.h glibc-2.32/sysdeps/aarch64/dl-machine.h
+--- glibc-2.32.orig/sysdeps/aarch64/dl-machine.h 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/dl-machine.h 2021-09-18 21:03:05.313302322 +1000
+@@ -395,13 +395,6 @@ elf_machine_lazy_rel (struct link_map *m
/* Check for unexpected PLT reloc type. */
if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1))
{
@@ -2849,7 +3801,7 @@ index 70b9ed3925..fde7cfd9e2 100644
if (__glibc_unlikely (map->l_info[DT_AARCH64 (VARIANT_PCS)] != NULL))
{
/* Check the symbol table for variant PCS symbols. */
-@@ -425,7 +418,10 @@ elf_machine_lazy_rel (struct link_map *map,
+@@ -425,7 +418,10 @@ elf_machine_lazy_rel (struct link_map *m
}
}
@@ -2861,10 +3813,9 @@ index 70b9ed3925..fde7cfd9e2 100644
}
else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1))
{
-diff --git a/sysdeps/aarch64/dl-prop.h b/sysdeps/aarch64/dl-prop.h
-index b0785bda83..e926e54984 100644
---- a/sysdeps/aarch64/dl-prop.h
-+++ b/sysdeps/aarch64/dl-prop.h
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/dl-prop.h glibc-2.32/sysdeps/aarch64/dl-prop.h
+--- glibc-2.32.orig/sysdeps/aarch64/dl-prop.h 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/dl-prop.h 2021-09-18 21:03:05.313302322 +1000
@@ -19,6 +19,8 @@
#ifndef _DL_PROP_H
#define _DL_PROP_H
@@ -2896,7 +3847,7 @@ index b0785bda83..e926e54984 100644
if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND)
{
/* Stop if the property note is ill-formed. */
-@@ -51,7 +57,7 @@ _dl_process_gnu_property (struct link_map *l, uint32_t type, uint32_t datasz,
+@@ -51,7 +57,7 @@ _dl_process_gnu_property (struct link_ma
unsigned int feature_1 = *(unsigned int *) data;
if (feature_1 & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
@@ -2905,10 +3856,9 @@ index b0785bda83..e926e54984 100644
/* Stop if we processed the property note. */
return 0;
-diff --git a/sysdeps/aarch64/linkmap.h b/sysdeps/aarch64/linkmap.h
-index 847a03ace2..b3f7663b07 100644
---- a/sysdeps/aarch64/linkmap.h
-+++ b/sysdeps/aarch64/linkmap.h
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/linkmap.h glibc-2.32/sysdeps/aarch64/linkmap.h
+--- glibc-2.32.orig/sysdeps/aarch64/linkmap.h 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/linkmap.h 2021-09-18 21:03:05.313302322 +1000
@@ -22,5 +22,5 @@ struct link_map_machine
{
ElfW(Addr) plt; /* Address of .plt */
@@ -2916,24 +3866,9 @@ index 847a03ace2..b3f7663b07 100644
- bool bti; /* Branch Target Identification is enabled. */
+ bool bti_fail; /* Failed to enable Branch Target Identification. */
};
-diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c
-index 7cf5f033e8..799d60c98c 100644
---- a/sysdeps/aarch64/multiarch/memcpy.c
-+++ b/sysdeps/aarch64/multiarch/memcpy.c
-@@ -41,7 +41,8 @@ libc_ifunc (__libc_memcpy,
- ? __memcpy_falkor
- : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
- ? __memcpy_thunderx2
-- : (IS_NEOVERSE_N1 (midr)
-+ : (IS_NEOVERSE_N1 (midr) || IS_NEOVERSE_N2 (midr)
-+ || IS_NEOVERSE_V1 (midr)
- ? __memcpy_simd
- : __memcpy_generic)))));
-
-diff --git a/sysdeps/aarch64/multiarch/memcpy_advsimd.S b/sysdeps/aarch64/multiarch/memcpy_advsimd.S
-index d4ba747777..48bb6d7ca4 100644
---- a/sysdeps/aarch64/multiarch/memcpy_advsimd.S
-+++ b/sysdeps/aarch64/multiarch/memcpy_advsimd.S
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy_advsimd.S glibc-2.32/sysdeps/aarch64/multiarch/memcpy_advsimd.S
+--- glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy_advsimd.S 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/multiarch/memcpy_advsimd.S 2021-09-18 21:03:05.313302322 +1000
@@ -223,12 +223,13 @@ L(copy_long_backwards):
b.ls L(copy64_from_start)
@@ -2951,10 +3886,22 @@ index d4ba747777..48bb6d7ca4 100644
subs count, count, 64
b.hi L(loop64_backwards)
-diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c
-index ad10aa8ac6..46a4cb3a54 100644
---- a/sysdeps/aarch64/multiarch/memmove.c
-+++ b/sysdeps/aarch64/multiarch/memmove.c
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy.c glibc-2.32/sysdeps/aarch64/multiarch/memcpy.c
+--- glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy.c 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/multiarch/memcpy.c 2021-09-18 21:03:05.313302322 +1000
+@@ -41,7 +41,8 @@ libc_ifunc (__libc_memcpy,
+ ? __memcpy_falkor
+ : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
+ ? __memcpy_thunderx2
+- : (IS_NEOVERSE_N1 (midr)
++ : (IS_NEOVERSE_N1 (midr) || IS_NEOVERSE_N2 (midr)
++ || IS_NEOVERSE_V1 (midr)
+ ? __memcpy_simd
+ : __memcpy_generic)))));
+
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/multiarch/memmove.c glibc-2.32/sysdeps/aarch64/multiarch/memmove.c
+--- glibc-2.32.orig/sysdeps/aarch64/multiarch/memmove.c 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/multiarch/memmove.c 2021-09-18 21:03:05.313302322 +1000
@@ -41,7 +41,8 @@ libc_ifunc (__libc_memmove,
? __memmove_falkor
: (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
@@ -2965,10 +3912,9 @@ index ad10aa8ac6..46a4cb3a54 100644
? __memmove_simd
: __memmove_generic)))));
-diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
-index 75393e1c18..1998ea95d4 100644
---- a/sysdeps/aarch64/start.S
-+++ b/sysdeps/aarch64/start.S
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/start.S glibc-2.32/sysdeps/aarch64/start.S
+--- glibc-2.32.orig/sysdeps/aarch64/start.S 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/start.S 2021-09-18 21:03:05.313302322 +1000
@@ -43,11 +43,9 @@
*/
@@ -2994,10 +3940,9 @@ index 75393e1c18..1998ea95d4 100644
/* Define a symbol for the first piece of initialized data. */
.data
-diff --git a/sysdeps/generic/dl-prop.h b/sysdeps/generic/dl-prop.h
-index f1cf576fe3..df27ff8e6a 100644
---- a/sysdeps/generic/dl-prop.h
-+++ b/sysdeps/generic/dl-prop.h
+diff -pruN glibc-2.32.orig/sysdeps/generic/dl-prop.h glibc-2.32/sysdeps/generic/dl-prop.h
+--- glibc-2.32.orig/sysdeps/generic/dl-prop.h 2021-09-18 21:02:32.705184785 +1000
++++ glibc-2.32/sysdeps/generic/dl-prop.h 2021-09-18 21:03:05.313302322 +1000
@@ -37,15 +37,15 @@ _dl_open_check (struct link_map *m)
}
@@ -3017,11 +3962,10 @@ index f1cf576fe3..df27ff8e6a 100644
{
return 0;
}
-diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
-index ba114ab4b1..62ac40d81b 100644
---- a/sysdeps/generic/ldsodefs.h
-+++ b/sysdeps/generic/ldsodefs.h
-@@ -919,8 +919,9 @@ extern void _dl_rtld_di_serinfo (struct link_map *loader,
+diff -pruN glibc-2.32.orig/sysdeps/generic/ldsodefs.h glibc-2.32/sysdeps/generic/ldsodefs.h
+--- glibc-2.32.orig/sysdeps/generic/ldsodefs.h 2021-09-18 21:02:32.705184785 +1000
++++ glibc-2.32/sysdeps/generic/ldsodefs.h 2021-09-18 21:03:05.313302322 +1000
+@@ -919,8 +919,9 @@ extern void _dl_rtld_di_serinfo (struct
Dl_serinfo *si, bool counting);
/* Process PT_GNU_PROPERTY program header PH in module L after
@@ -3033,11 +3977,10 @@ index ba114ab4b1..62ac40d81b 100644
/* Search loaded objects' symbol tables for a definition of the symbol
-diff --git a/sysdeps/generic/unwind.h b/sysdeps/generic/unwind.h
-index b667a5b652..c229603af3 100644
---- a/sysdeps/generic/unwind.h
-+++ b/sysdeps/generic/unwind.h
-@@ -75,15 +75,21 @@ typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+diff -pruN glibc-2.32.orig/sysdeps/generic/unwind.h glibc-2.32/sysdeps/generic/unwind.h
+--- glibc-2.32.orig/sysdeps/generic/unwind.h 2021-09-18 21:02:32.706184819 +1000
++++ glibc-2.32/sysdeps/generic/unwind.h 2021-09-18 21:03:05.313302322 +1000
+@@ -75,15 +75,21 @@ typedef void (*_Unwind_Exception_Cleanup
struct _Unwind_Exception
{
@@ -3045,11 +3988,6 @@ index b667a5b652..c229603af3 100644
- _Unwind_Exception_Cleanup_Fn exception_cleanup;
- _Unwind_Word private_1;
- _Unwind_Word private_2;
--
-- /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
-- Taking that literally does not make much sense generically. Instead we
-- provide the maximum alignment required by any type for the machine. */
--} __attribute__((__aligned__));
+ union
+ {
+ struct
@@ -3059,7 +3997,11 @@ index b667a5b652..c229603af3 100644
+ _Unwind_Word private_1;
+ _Unwind_Word private_2;
+ };
-+
+
+- /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+- Taking that literally does not make much sense generically. Instead we
+- provide the maximum alignment required by any type for the machine. */
+-} __attribute__((__aligned__));
+ /* The IA-64 ABI says that this structure must be double-word aligned. */
+ _Unwind_Word unwind_exception_align[2]
+ __attribute__ ((__aligned__ (2 * sizeof (_Unwind_Word))));
@@ -3068,10 +4010,9 @@ index b667a5b652..c229603af3 100644
/* The ACTIONS argument to the personality routine is a bitwise OR of one
-diff --git a/sysdeps/gnu/errlist.h b/sysdeps/gnu/errlist.h
-index 5d11ed723d..6329e5f393 100644
---- a/sysdeps/gnu/errlist.h
-+++ b/sysdeps/gnu/errlist.h
+diff -pruN glibc-2.32.orig/sysdeps/gnu/errlist.h glibc-2.32/sysdeps/gnu/errlist.h
+--- glibc-2.32.orig/sysdeps/gnu/errlist.h 2021-09-18 21:02:32.706184819 +1000
++++ glibc-2.32/sysdeps/gnu/errlist.h 2021-09-18 21:03:05.313302322 +1000
@@ -1,24 +1,21 @@
-#ifndef ERR_MAP
-#define ERR_MAP(value) value
@@ -3116,7 +4057,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENXIO
/*
-@@ -43,7 +40,7 @@ TRANS represented by a file you specified, and it couldn't find the device.
+@@ -43,7 +40,7 @@ TRANS represented by a file you specifie
TRANS This can mean that the device file was installed incorrectly, or that
TRANS the physical device is missing or not correctly attached to the
TRANS computer. */
@@ -3125,7 +4066,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef E2BIG
/*
-@@ -51,27 +48,27 @@ TRANS Used when the arguments passed to a new program
+@@ -51,27 +48,27 @@ TRANS Used when the arguments passed to
TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
TRANS File}) occupy too much memory space. This condition never arises on
TRANS @gnuhurdsystems{}. */
@@ -3157,7 +4098,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EDEADLK
/*
-@@ -79,74 +76,74 @@ TRANS Allocating a system resource would have resulted in a
+@@ -79,74 +76,74 @@ TRANS Allocating a system resource would
TRANS deadlock situation. The system does not guarantee that it will notice
TRANS all such situations. This error means you got lucky and the system
TRANS noticed; it might just hang. @xref{File Locks}, for an example. */
@@ -3244,7 +4185,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EMFILE
/*
-@@ -157,20 +154,20 @@ TRANS In BSD and GNU, the number of open files is controlled by a resource
+@@ -157,20 +154,20 @@ TRANS In BSD and GNU, the number of open
TRANS limit that can usually be increased. If you get this error, you might
TRANS want to increase the @code{RLIMIT_NOFILE} limit or make it unlimited;
TRANS @pxref{Limits on Resources}. */
@@ -3268,7 +4209,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ETXTBSY
/*
-@@ -179,35 +176,35 @@ TRANS write to a file that is currently being executed. Often using a
+@@ -179,35 +176,35 @@ TRANS write to a file that is currently
TRANS debugger to run a program is considered having it open for writing and
TRANS will cause this error. (The name stands for ``text file busy''.) This
TRANS is not an error on @gnuhurdsystems{}; the text is copied as necessary. */
@@ -3310,7 +4251,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EPIPE
/*
-@@ -216,19 +213,19 @@ TRANS Every library function that returns this error code also generates a
+@@ -216,19 +213,19 @@ TRANS Every library function that return
TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
TRANS or blocked. Thus, your program will never actually see @code{EPIPE}
TRANS unless it has handled or blocked @code{SIGPIPE}. */
@@ -3333,7 +4274,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EAGAIN
/*
-@@ -261,7 +258,7 @@ TRANS Such shortages are usually fairly serious and affect the whole system,
+@@ -261,7 +258,7 @@ TRANS Such shortages are usually fairly
TRANS so usually an interactive program should report the error to the user
TRANS and return to its command loop.
TRANS @end itemize */
@@ -3342,7 +4283,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EINPROGRESS
/*
-@@ -273,47 +270,47 @@ TRANS the operation has begun and will take some time. Attempts to manipulate
+@@ -273,47 +270,47 @@ TRANS the operation has begun and will t
TRANS the object before the call completes return @code{EALREADY}. You can
TRANS use the @code{select} function to find out when the pending operation
TRANS has completed; @pxref{Waiting for I/O}. */
@@ -3398,7 +4339,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EOPNOTSUPP
/*
-@@ -323,71 +320,71 @@ TRANS implemented for all communications protocols. On @gnuhurdsystems{}, this
+@@ -323,71 +320,71 @@ TRANS implemented for all communications
TRANS error can happen for many calls when the object does not support the
TRANS particular operation; it is a generic indication that the server knows
TRANS nothing to do for that call. */
@@ -3482,7 +4423,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENOTCONN
/*
-@@ -395,74 +392,74 @@ TRANS The socket is not connected to anything. You get this error when you
+@@ -395,74 +392,74 @@ TRANS The socket is not connected to any
TRANS try to transmit data over a socket, without first specifying a
TRANS destination for the data. For a connectionless socket (for datagram
TRANS protocols, such as UDP), you get @code{EDESTADDRREQ} instead. */
@@ -3570,7 +4511,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ESTALE
/*
-@@ -471,7 +468,7 @@ TRANS file system which is due to file system rearrangements on the server host
+@@ -471,7 +468,7 @@ TRANS file system which is due to file s
TRANS for NFS file systems or corruption in other file systems.
TRANS Repairing this condition usually requires unmounting, possibly repairing
TRANS and remounting the file system. */
@@ -3579,7 +4520,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EREMOTE
/*
-@@ -479,7 +476,7 @@ TRANS An attempt was made to NFS-mount a remote file system with a file name tha
+@@ -479,7 +476,7 @@ TRANS An attempt was made to NFS-mount a
TRANS already specifies an NFS-mounted file.
TRANS (This is an error on some operating systems, but we expect it to work
TRANS properly on @gnuhurdsystems{}, making this error code impossible.) */
@@ -3588,7 +4529,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENOLCK
/*
-@@ -487,7 +484,7 @@ TRANS This is used by the file locking facilities; see
+@@ -487,7 +484,7 @@ TRANS This is used by the file locking f
TRANS @ref{File Locks}. This error is never generated by @gnuhurdsystems{}, but
TRANS it can result from an operation to an NFS server running another
TRANS operating system. */
@@ -3597,7 +4538,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENOSYS
/*
-@@ -496,46 +493,46 @@ TRANS not implemented at all, either in the C library itself or in the
+@@ -496,46 +493,46 @@ TRANS not implemented at all, either in
TRANS operating system. When you get this error, you can be sure that this
TRANS particular function will always fail with @code{ENOSYS} unless you
TRANS install a new version of the C library or the operating system. */
@@ -3657,7 +4598,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ECANCELED
/*
-@@ -543,148 +540,148 @@ TRANS An asynchronous operation was canceled before it
+@@ -543,148 +540,148 @@ TRANS An asynchronous operation was canc
TRANS completed. @xref{Asynchronous I/O}. When you call @code{aio_cancel},
TRANS the normal result is for the operations affected to complete with this
TRANS error; @pxref{Cancel AIO Operations}. */
@@ -3854,7 +4795,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EFTYPE
/*
-@@ -693,40 +690,40 @@ TRANS operation, or a data file had the wrong format.
+@@ -693,40 +690,40 @@ TRANS operation, or a data file had the
TRANS
TRANS On some systems @code{chmod} returns this error if you try to set the
TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}. */
@@ -3916,7 +4857,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EBACKGROUND
/*
-@@ -755,7 +752,7 @@ TRANS foreground process group of the terminal. Users do not usually see this
+@@ -755,7 +752,7 @@ TRANS foreground process group of the te
TRANS error because functions such as @code{read} and @code{write} translate
TRANS it into a @code{SIGTTIN} or @code{SIGTTOU} signal. @xref{Job Control},
TRANS for information on process groups and these signals. */
@@ -3925,7 +4866,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EIEIO
/*
-@@ -773,7 +770,7 @@ TRANS @c "bought the farm" means "died". -jtobey
+@@ -773,7 +770,7 @@ TRANS @c "bought the farm" means "died".
TRANS @c
TRANS @c Translators, please do not translate this litteraly, translate it into
TRANS @c an idiomatic funny way of saying that the computer died. */
@@ -3934,7 +4875,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
/*
-@@ -782,18 +779,18 @@ TRANS The values are always the same, on every operating system.
+@@ -782,18 +779,18 @@ TRANS The values are always the same, on
TRANS
TRANS C libraries in many older Unix systems have @code{EWOULDBLOCK} as a
TRANS separate error code. */
@@ -3957,11 +4898,10 @@ index 5d11ed723d..6329e5f393 100644
-_S(ERR_MAP(EPROGUNAVAIL), N_("RPC program not available"))
+_S(EPROGUNAVAIL, N_("RPC program not available"))
#endif
-diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
-index 0f08079e48..672d8f27ce 100644
---- a/sysdeps/i386/dl-machine.h
-+++ b/sysdeps/i386/dl-machine.h
-@@ -338,16 +338,22 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+diff -pruN glibc-2.32.orig/sysdeps/i386/dl-machine.h glibc-2.32/sysdeps/i386/dl-machine.h
+--- glibc-2.32.orig/sysdeps/i386/dl-machine.h 2021-09-18 21:02:32.707184853 +1000
++++ glibc-2.32/sysdeps/i386/dl-machine.h 2021-09-18 21:03:05.313302322 +1000
+@@ -338,16 +338,22 @@ elf_machine_rel (struct link_map *map, c
{
# ifndef RTLD_BOOTSTRAP
if (sym_map != map
@@ -3989,10 +4929,9 @@ index 0f08079e48..672d8f27ce 100644
}
# endif
value = ((Elf32_Addr (*) (void)) value) ();
-diff --git a/sysdeps/powerpc/powerpc64/backtrace.c b/sysdeps/powerpc/powerpc64/backtrace.c
-index 8a53a1088f..362a2b713c 100644
---- a/sysdeps/powerpc/powerpc64/backtrace.c
-+++ b/sysdeps/powerpc/powerpc64/backtrace.c
+diff -pruN glibc-2.32.orig/sysdeps/powerpc/powerpc64/backtrace.c glibc-2.32/sysdeps/powerpc/powerpc64/backtrace.c
+--- glibc-2.32.orig/sysdeps/powerpc/powerpc64/backtrace.c 2021-09-18 21:02:32.723185402 +1000
++++ glibc-2.32/sysdeps/powerpc/powerpc64/backtrace.c 2021-09-18 21:03:05.313302322 +1000
@@ -54,11 +54,22 @@ struct signal_frame_64 {
/* We don't care about the rest, since the IP value is at 'uc' field. */
};
@@ -4017,37 +4956,94 @@ index 8a53a1088f..362a2b713c 100644
return true;
#endif
return false;
-diff --git a/sysdeps/sh/be/sh4/fpu/Implies b/sysdeps/sh/be/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..71b28ee1a4
---- /dev/null
-+++ b/sysdeps/sh/be/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/s390/configure glibc-2.32/sysdeps/s390/configure
+--- glibc-2.32.orig/sysdeps/s390/configure 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/configure 2021-09-18 21:03:05.313302322 +1000
+@@ -123,7 +123,9 @@ void testinsn (char *buf)
+ __asm__ (".machine \"arch13\" \n\t"
+ ".machinemode \"zarch_nohighgprs\" \n\t"
+ "lghi %%r0,16 \n\t"
+- "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
++ "mvcrl 0(%0),32(%0) \n\t"
++ "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
++ : : "a" (buf) : "memory", "r0");
+ }
+ EOF
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+@@ -271,7 +273,9 @@ else
+ void testinsn (char *buf)
+ {
+ __asm__ ("lghi %%r0,16 \n\t"
+- "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
++ "mvcrl 0(%0),32(%0) \n\t"
++ "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
++ : : "a" (buf) : "memory", "r0");
+ }
+ EOF
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+diff -pruN glibc-2.32.orig/sysdeps/s390/configure.ac glibc-2.32/sysdeps/s390/configure.ac
+--- glibc-2.32.orig/sysdeps/s390/configure.ac 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/configure.ac 2021-09-18 21:03:05.313302322 +1000
+@@ -88,7 +88,9 @@ void testinsn (char *buf)
+ __asm__ (".machine \"arch13\" \n\t"
+ ".machinemode \"zarch_nohighgprs\" \n\t"
+ "lghi %%r0,16 \n\t"
+- "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
++ "mvcrl 0(%0),32(%0) \n\t"
++ "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
++ : : "a" (buf) : "memory", "r0");
+ }
+ EOF
+ dnl test, if assembler supports S390 arch13 instructions
+@@ -195,7 +197,9 @@ cat > conftest.c <<\EOF
+ void testinsn (char *buf)
+ {
+ __asm__ ("lghi %%r0,16 \n\t"
+- "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
++ "mvcrl 0(%0),32(%0) \n\t"
++ "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
++ : : "a" (buf) : "memory", "r0");
+ }
+ EOF
+ dnl test, if assembler supports S390 arch13 zarch instructions as default
+diff -pruN glibc-2.32.orig/sysdeps/s390/memmove.c glibc-2.32/sysdeps/s390/memmove.c
+--- glibc-2.32.orig/sysdeps/s390/memmove.c 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/memmove.c 2021-09-18 21:03:05.313302322 +1000
+@@ -43,7 +43,7 @@ extern __typeof (__redirect_memmove) MEM
+ s390_libc_ifunc_expr (__redirect_memmove, memmove,
+ ({
+ s390_libc_ifunc_expr_stfle_init ();
+- (HAVE_MEMMOVE_ARCH13
++ (HAVE_MEMMOVE_ARCH13 && (hwcap & HWCAP_S390_VXRS_EXT2)
+ && S390_IS_ARCH13_MIE3 (stfle_bits))
+ ? MEMMOVE_ARCH13
+ : (HAVE_MEMMOVE_Z13 && (hwcap & HWCAP_S390_VX))
+diff -pruN glibc-2.32.orig/sysdeps/s390/multiarch/ifunc-impl-list.c glibc-2.32/sysdeps/s390/multiarch/ifunc-impl-list.c
+--- glibc-2.32.orig/sysdeps/s390/multiarch/ifunc-impl-list.c 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/multiarch/ifunc-impl-list.c 2021-09-18 21:03:05.313302322 +1000
+@@ -171,7 +171,8 @@ __libc_ifunc_impl_list (const char *name
+ IFUNC_IMPL (i, name, memmove,
+ # if HAVE_MEMMOVE_ARCH13
+ IFUNC_IMPL_ADD (array, i, memmove,
+- S390_IS_ARCH13_MIE3 (stfle_bits),
++ ((dl_hwcap & HWCAP_S390_VXRS_EXT2)
++ && S390_IS_ARCH13_MIE3 (stfle_bits)),
+ MEMMOVE_ARCH13)
+ # endif
+ # if HAVE_MEMMOVE_Z13
+diff -pruN glibc-2.32.orig/sysdeps/sh/be/sh4/fpu/Implies glibc-2.32/sysdeps/sh/be/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/sh/be/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/sh/be/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+sh/sh4/fpu
-diff --git a/sysdeps/sh/le/sh4/fpu/Implies b/sysdeps/sh/le/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..71b28ee1a4
---- /dev/null
-+++ b/sysdeps/sh/le/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/sh/le/sh4/fpu/Implies glibc-2.32/sysdeps/sh/le/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/sh/le/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/sh/le/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+sh/sh4/fpu
-diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index 9b2a253032..34748ffcd1 100644
---- a/sysdeps/unix/sysv/linux/Makefile
-+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -100,7 +100,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
- tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
- test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
- tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
-- tst-tgkill
-+ tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux
- tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
-
- CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
-diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
-index fc688450ee..00a4d0c8e7 100644
---- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
-+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/aarch64/cpu-features.h glibc-2.32/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/aarch64/cpu-features.h 2021-09-18 21:02:32.731185676 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/aarch64/cpu-features.h 2021-09-18 21:03:05.313302322 +1000
@@ -54,6 +54,10 @@
&& MIDR_PARTNUM(midr) == 0x000)
#define IS_NEOVERSE_N1(midr) (MIDR_IMPLEMENTOR(midr) == 'A' \
@@ -4059,11 +5055,72 @@ index fc688450ee..00a4d0c8e7 100644
#define IS_EMAG(midr) (MIDR_IMPLEMENTOR(midr) == 'P' \
&& MIDR_PARTNUM(midr) == 0x000)
-diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
-index 0776472d5e..a1f24ab242 100644
---- a/sysdeps/unix/sysv/linux/msgctl.c
-+++ b/sysdeps/unix/sysv/linux/msgctl.c
-@@ -90,8 +90,15 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/Makefile glibc-2.32/sysdeps/unix/sysv/linux/Makefile
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/Makefile 2021-09-18 21:02:32.731185676 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/Makefile 2021-09-18 21:03:05.313302322 +1000
+@@ -100,7 +100,7 @@ tests += tst-clone tst-clone2 tst-clone3
+ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
+ test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
+ tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
+- tst-tgkill
++ tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux
+ tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
+
+ CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/mq_notify.c glibc-2.32/sysdeps/unix/sysv/linux/mq_notify.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/mq_notify.c 2021-09-18 21:02:32.736185847 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/mq_notify.c 2021-09-18 21:09:50.680196980 +1000
+@@ -132,9 +132,12 @@ helper_thread (void *arg)
+ to wait until it is done with it. */
+ (void) __pthread_barrier_wait (¬ify_barrier);
+ }
+- else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
+- /* The only state we keep is the copy of the thread attributes. */
+- free (data.attr);
++ else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED && data.attr != NULL)
++ {
++ /* The only state we keep is the copy of the thread attributes. */
++ pthread_attr_destroy (data.attr);
++ free (data.attr);
++ }
+ }
+ return NULL;
+ }
+@@ -255,8 +258,14 @@ mq_notify (mqd_t mqdes, const struct sig
+ if (data.attr == NULL)
+ return -1;
+
+- memcpy (data.attr, notification->sigev_notify_attributes,
+- sizeof (pthread_attr_t));
++ int ret = __pthread_attr_copy (data.attr,
++ notification->sigev_notify_attributes);
++ if (ret != 0)
++ {
++ free (data.attr);
++ __set_errno (ret);
++ return -1;
++ }
+ }
+
+ /* Construct the new request. */
+@@ -269,8 +278,11 @@ mq_notify (mqd_t mqdes, const struct sig
+ int retval = INLINE_SYSCALL (mq_notify, 2, mqdes, &se);
+
+ /* If it failed, free the allocated memory. */
+- if (__glibc_unlikely (retval != 0))
+- free (data.attr);
++ if (retval != 0 && data.attr != NULL)
++ {
++ pthread_attr_destroy (data.attr);
++ free (data.attr);
++ }
+
+ return retval;
+ }
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/msgctl.c glibc-2.32/sysdeps/unix/sysv/linux/msgctl.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/msgctl.c 2021-09-18 21:02:32.736185847 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/msgctl.c 2021-09-18 21:03:05.313302322 +1000
+@@ -90,8 +90,15 @@ __msgctl64 (int msqid, int cmd, struct _
struct kernel_msqid64_ds ksemid, *arg = NULL;
if (buf != NULL)
{
@@ -4081,7 +5138,7 @@ index 0776472d5e..a1f24ab242 100644
}
# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
if (cmd == IPC_SET)
-@@ -169,8 +176,15 @@ __msgctl (int msqid, int cmd, struct msqid_ds *buf)
+@@ -169,8 +176,15 @@ __msgctl (int msqid, int cmd, struct msq
struct __msqid64_ds msqid64, *buf64 = NULL;
if (buf != NULL)
{
@@ -4099,11 +5156,10 @@ index 0776472d5e..a1f24ab242 100644
}
int ret = __msgctl64 (msqid, cmd, buf64);
-diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
-index f131a26fc7..1cdabde8f2 100644
---- a/sysdeps/unix/sysv/linux/semctl.c
-+++ b/sysdeps/unix/sysv/linux/semctl.c
-@@ -102,6 +102,7 @@ semun64_to_ksemun64 (int cmd, union semun64 semun64,
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/semctl.c glibc-2.32/sysdeps/unix/sysv/linux/semctl.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/semctl.c 2021-09-18 21:02:32.739185950 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/semctl.c 2021-09-18 21:03:05.313302322 +1000
+@@ -102,6 +102,7 @@ semun64_to_ksemun64 (int cmd, union semu
r.array = semun64.array;
break;
case SEM_STAT:
@@ -4111,7 +5167,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_STAT:
case IPC_SET:
r.buf = buf;
-@@ -150,6 +151,7 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+@@ -150,6 +151,7 @@ __semctl64 (int semid, int semnum, int c
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -4119,7 +5175,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-@@ -238,6 +240,7 @@ semun_to_semun64 (int cmd, union semun semun, struct __semid64_ds *semid64)
+@@ -238,6 +240,7 @@ semun_to_semun64 (int cmd, union semun s
r.array = semun.array;
break;
case SEM_STAT:
@@ -4127,7 +5183,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_STAT:
case IPC_SET:
r.buf = semid64;
-@@ -267,6 +270,7 @@ __semctl (int semid, int semnum, int cmd, ...)
+@@ -267,6 +270,7 @@ __semctl (int semid, int semnum, int cmd
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -4135,7 +5191,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-@@ -321,6 +325,7 @@ __semctl_mode16 (int semid, int semnum, int cmd, ...)
+@@ -321,6 +325,7 @@ __semctl_mode16 (int semid, int semnum,
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -4143,7 +5199,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-@@ -354,6 +359,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
+@@ -354,6 +359,7 @@ __old_semctl (int semid, int semnum, int
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -4151,25 +5207,20 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-diff --git a/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies b/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..7eeaf15a5a
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies glibc-2.32/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+unix/sysv/linux/sh/sh4/fpu
-diff --git a/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies b/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..7eeaf15a5a
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies glibc-2.32/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+unix/sysv/linux/sh/sh4/fpu
-diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
-index 76d88441f1..1d19a798b1 100644
---- a/sysdeps/unix/sysv/linux/shmctl.c
-+++ b/sysdeps/unix/sysv/linux/shmctl.c
-@@ -90,8 +90,15 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/shmctl.c glibc-2.32/sysdeps/unix/sysv/linux/shmctl.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/shmctl.c 2021-09-18 21:02:32.740185984 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/shmctl.c 2021-09-18 21:03:05.313302322 +1000
+@@ -90,8 +90,15 @@ __shmctl64 (int shmid, int cmd, struct _
struct kernel_shmid64_ds kshmid, *arg = NULL;
if (buf != NULL)
{
@@ -4187,7 +5238,7 @@ index 76d88441f1..1d19a798b1 100644
}
# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
if (cmd == IPC_SET)
-@@ -107,7 +114,6 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+@@ -107,7 +114,6 @@ __shmctl64 (int shmid, int cmd, struct _
switch (cmd)
{
@@ -4195,7 +5246,7 @@ index 76d88441f1..1d19a798b1 100644
case IPC_STAT:
case SHM_STAT:
case SHM_STAT_ANY:
-@@ -168,8 +174,15 @@ __shmctl (int shmid, int cmd, struct shmid_ds *buf)
+@@ -168,8 +174,15 @@ __shmctl (int shmid, int cmd, struct shm
struct __shmid64_ds shmid64, *buf64 = NULL;
if (buf != NULL)
{
@@ -4213,7 +5264,7 @@ index 76d88441f1..1d19a798b1 100644
}
int ret = __shmctl64 (shmid, cmd, buf64);
-@@ -178,7 +191,6 @@ __shmctl (int shmid, int cmd, struct shmid_ds *buf)
+@@ -178,7 +191,6 @@ __shmctl (int shmid, int cmd, struct shm
switch (cmd)
{
@@ -4221,11 +5272,9 @@ index 76d88441f1..1d19a798b1 100644
case IPC_STAT:
case SHM_STAT:
case SHM_STAT_ANY:
-diff --git a/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c b/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
-new file mode 100644
-index 0000000000..630f4f792c
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1,177 @@
+/* Basic tests for Linux SYSV message queue extensions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -4404,11 +5453,9 @@ index 0000000000..630f4f792c
+}
+
+#include <support/test-driver.c>
-diff --git a/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c b/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
-new file mode 100644
-index 0000000000..45f19e2d37
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c 2021-09-18 21:03:05.314302356 +1000
@@ -0,0 +1,184 @@
+/* Basic tests for Linux SYSV semaphore extensions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -4594,11 +5641,9 @@ index 0000000000..45f19e2d37
+}
+
+#include <support/test-driver.c>
-diff --git a/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
-new file mode 100644
-index 0000000000..7128ae2e14
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c 2021-09-18 21:03:05.314302356 +1000
@@ -0,0 +1,185 @@
+/* Basic tests for Linux SYSV shared memory extensions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -4785,27 +5830,41 @@ index 0000000000..7128ae2e14
+}
+
+#include <support/test-driver.c>
-diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
-index a6736aef25..9736a13e7b 100644
---- a/sysdeps/x86/Makefile
-+++ b/sysdeps/x86/Makefile
-@@ -12,6 +12,12 @@ endif
- ifeq ($(subdir),setjmp)
- gen-as-const-headers += jmp_buf-ssp.sym
- sysdep_routines += __longjmp_cancel
-+ifneq ($(enable-cet),no)
-+ifneq ($(have-tunables),no)
-+tests += tst-setjmp-cet
-+tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
-+endif
-+endif
- endif
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/64/configure glibc-2.32/sysdeps/unix/sysv/linux/x86_64/64/configure
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/64/configure 2021-09-18 21:02:32.741186019 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/x86_64/64/configure 2021-09-18 21:03:05.314302356 +1000
+@@ -4,10 +4,10 @@
+ test -n "$libc_cv_slibdir" ||
+ case "$prefix" in
+ /usr | /usr/)
+- libc_cv_slibdir='/lib64'
+- libc_cv_rtlddir='/lib64'
++ libc_cv_slibdir='/lib'
++ libc_cv_rtlddir='/lib'
+ if test "$libdir" = '${exec_prefix}/lib'; then
+- libdir='${exec_prefix}/lib64';
++ libdir='${exec_prefix}/lib';
+ # Locale data can be shared between 32-bit and 64-bit libraries.
+ libc_cv_complocaledir='${exec_prefix}/lib/locale'
+ fi
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/ldconfig.h glibc-2.32/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/ldconfig.h 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/x86_64/ldconfig.h 2021-09-18 21:03:05.314302356 +1000
+@@ -18,9 +18,9 @@
+ #include <sysdeps/generic/ldconfig.h>
- ifeq ($(subdir),string)
-diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
-index 217c21c34f..3fb4a028d8 100644
---- a/sysdeps/x86/cacheinfo.c
-+++ b/sysdeps/x86/cacheinfo.c
+ #define SYSDEP_KNOWN_INTERPRETER_NAMES \
+- { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
++ { "/lib32/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
+ { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \
+- { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
++ { "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
+ #define SYSDEP_KNOWN_LIBRARY_NAMES \
+ { "libc.so.6", FLAG_ELF_LIBC6 }, \
+ { "libm.so.6", FLAG_ELF_LIBC6 },
+diff -pruN glibc-2.32.orig/sysdeps/x86/cacheinfo.c glibc-2.32/sysdeps/x86/cacheinfo.c
+--- glibc-2.32.orig/sysdeps/x86/cacheinfo.c 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/cacheinfo.c 2021-09-18 21:03:05.314302356 +1000
@@ -808,7 +808,7 @@ init_cacheinfo (void)
threads = 1 << ((ecx >> 12) & 0x0f);
}
@@ -4866,11 +5925,10 @@ index 217c21c34f..3fb4a028d8 100644
/* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8. */
unsigned int minimum_rep_movsb_threshold;
-diff --git a/sysdeps/x86/dl-cet.c b/sysdeps/x86/dl-cet.c
-index 03572f7af6..3cc54a8d53 100644
---- a/sysdeps/x86/dl-cet.c
-+++ b/sysdeps/x86/dl-cet.c
-@@ -47,7 +47,10 @@ dl_cet_check (struct link_map *m, const char *program)
+diff -pruN glibc-2.32.orig/sysdeps/x86/dl-cet.c glibc-2.32/sysdeps/x86/dl-cet.c
+--- glibc-2.32.orig/sysdeps/x86/dl-cet.c 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/dl-cet.c 2021-09-18 21:03:05.314302356 +1000
+@@ -47,7 +47,10 @@ dl_cet_check (struct link_map *m, const
/* No legacy object check if both IBT and SHSTK are always on. */
if (enable_ibt_type == cet_always_on
&& enable_shstk_type == cet_always_on)
@@ -4882,11 +5940,10 @@ index 03572f7af6..3cc54a8d53 100644
/* Check if IBT is enabled by kernel. */
bool ibt_enabled
-diff --git a/sysdeps/x86/dl-prop.h b/sysdeps/x86/dl-prop.h
-index 89911e19e2..4eb3b85a7b 100644
---- a/sysdeps/x86/dl-prop.h
-+++ b/sysdeps/x86/dl-prop.h
-@@ -145,15 +145,15 @@ _dl_process_cet_property_note (struct link_map *l,
+diff -pruN glibc-2.32.orig/sysdeps/x86/dl-prop.h glibc-2.32/sysdeps/x86/dl-prop.h
+--- glibc-2.32.orig/sysdeps/x86/dl-prop.h 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/dl-prop.h 2021-09-18 21:03:05.314302356 +1000
+@@ -145,15 +145,15 @@ _dl_process_cet_property_note (struct li
}
static inline void __attribute__ ((unused))
@@ -4905,18 +5962,109 @@ index 89911e19e2..4eb3b85a7b 100644
{
return 0;
}
-diff --git a/sysdeps/x86/tst-setjmp-cet.c b/sysdeps/x86/tst-setjmp-cet.c
-new file mode 100644
-index 0000000000..42c795d2a8
---- /dev/null
-+++ b/sysdeps/x86/tst-setjmp-cet.c
+diff -pruN glibc-2.32.orig/sysdeps/x86/Makefile glibc-2.32/sysdeps/x86/Makefile
+--- glibc-2.32.orig/sysdeps/x86/Makefile 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/Makefile 2021-09-18 21:03:05.314302356 +1000
+@@ -12,6 +12,12 @@ endif
+ ifeq ($(subdir),setjmp)
+ gen-as-const-headers += jmp_buf-ssp.sym
+ sysdep_routines += __longjmp_cancel
++ifneq ($(enable-cet),no)
++ifneq ($(have-tunables),no)
++tests += tst-setjmp-cet
++tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
++endif
++endif
+ endif
+
+ ifeq ($(subdir),string)
+diff -pruN glibc-2.32.orig/sysdeps/x86/tst-setjmp-cet.c glibc-2.32/sysdeps/x86/tst-setjmp-cet.c
+--- glibc-2.32.orig/sysdeps/x86/tst-setjmp-cet.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/x86/tst-setjmp-cet.c 2021-09-18 21:03:05.314302356 +1000
@@ -0,0 +1 @@
+#include <setjmp/tst-setjmp.c>
-diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
-index ca73d8fef9..363a749cb2 100644
---- a/sysdeps/x86_64/dl-machine.h
-+++ b/sysdeps/x86_64/dl-machine.h
-@@ -315,16 +315,22 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/configure glibc-2.32/sysdeps/x86_64/configure
+--- glibc-2.32.orig/sysdeps/x86_64/configure 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/configure 2021-09-18 21:03:05.314302356 +1000
+@@ -107,39 +107,6 @@ if test x"$build_mathvec" = xnotset; the
+ build_mathvec=yes
+ fi
+
+-if test "$static_pie" = yes; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker static PIE support" >&5
+-$as_echo_n "checking for linker static PIE support... " >&6; }
+-if ${libc_cv_ld_static_pie+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- cat > conftest.s <<\EOF
+- .text
+- .global _start
+- .weak foo
+-_start:
+- leaq foo(%rip), %rax
+-EOF
+- libc_cv_pie_option="-Wl,-pie"
+- if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&5'
+- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+- test $ac_status = 0; }; }; then
+- libc_cv_ld_static_pie=yes
+- else
+- libc_cv_ld_static_pie=no
+- fi
+-rm -f conftest*
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_static_pie" >&5
+-$as_echo "$libc_cv_ld_static_pie" >&6; }
+- if test "$libc_cv_ld_static_pie" != yes; then
+- as_fn_error $? "linker support for static PIE needed" "$LINENO" 5
+- fi
+-fi
+-
+ $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
+
+
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/configure.ac glibc-2.32/sysdeps/x86_64/configure.ac
+--- glibc-2.32.orig/sysdeps/x86_64/configure.ac 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/configure.ac 2021-09-18 21:03:05.314302356 +1000
+@@ -53,31 +53,6 @@ if test x"$build_mathvec" = xnotset; the
+ build_mathvec=yes
+ fi
+
+-dnl Check if linker supports static PIE with the fix for
+-dnl
+-dnl https://sourceware.org/bugzilla/show_bug.cgi?id=21782
+-dnl
+-if test "$static_pie" = yes; then
+- AC_CACHE_CHECK(for linker static PIE support, libc_cv_ld_static_pie, [dnl
+-cat > conftest.s <<\EOF
+- .text
+- .global _start
+- .weak foo
+-_start:
+- leaq foo(%rip), %rax
+-EOF
+- libc_cv_pie_option="-Wl,-pie"
+- if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&AS_MESSAGE_LOG_FD); then
+- libc_cv_ld_static_pie=yes
+- else
+- libc_cv_ld_static_pie=no
+- fi
+-rm -f conftest*])
+- if test "$libc_cv_ld_static_pie" != yes; then
+- AC_MSG_ERROR([linker support for static PIE needed])
+- fi
+-fi
+-
+ dnl It is always possible to access static and hidden symbols in an
+ dnl position independent way.
+ AC_DEFINE(PI_STATIC_AND_HIDDEN)
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/dl-machine.h glibc-2.32/sysdeps/x86_64/dl-machine.h
+--- glibc-2.32.orig/sysdeps/x86_64/dl-machine.h 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/dl-machine.h 2021-09-18 21:03:05.314302356 +1000
+@@ -315,16 +315,22 @@ elf_machine_rela (struct link_map *map,
{
# ifndef RTLD_BOOTSTRAP
if (sym_map != map
@@ -4944,10 +6092,9 @@ index ca73d8fef9..363a749cb2 100644
}
# endif
value = ((ElfW(Addr) (*) (void)) value) ();
-diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
-index 7659758972..e5fd5ac9cb 100644
---- a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
-+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h glibc-2.32/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
+--- glibc-2.32.orig/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h 2021-09-18 21:03:05.314302356 +1000
@@ -32,7 +32,7 @@ IFUNC_SELECTOR (void)
&& CPU_FEATURE_USABLE_P (cpu_features, AVX2))
return OPTIMIZE (fma);
@@ -4957,10 +6104,9 @@ index 7659758972..e5fd5ac9cb 100644
return OPTIMIZE (fma4);
return OPTIMIZE (sse2);
-diff --git a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
-index bd5dc1a3f3..092f364bb6 100644
---- a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
-+++ b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S glibc-2.32/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
+--- glibc-2.32.orig/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S 2021-09-18 21:02:32.745186156 +1000
++++ glibc-2.32/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S 2021-09-18 21:03:05.314302356 +1000
@@ -56,6 +56,13 @@
# endif
#endif
@@ -4997,10 +6143,9 @@ index bd5dc1a3f3..092f364bb6 100644
mov %RDX_LP, %RCX_LP
rep movsb
L(nop):
-diff --git a/sysvipc/test-sysvsem.c b/sysvipc/test-sysvsem.c
-index 01dbff343a..b7284e0b48 100644
---- a/sysvipc/test-sysvsem.c
-+++ b/sysvipc/test-sysvsem.c
+diff -pruN glibc-2.32.orig/sysvipc/test-sysvsem.c glibc-2.32/sysvipc/test-sysvsem.c
+--- glibc-2.32.orig/sysvipc/test-sysvsem.c 2021-09-18 21:02:32.746186190 +1000
++++ glibc-2.32/sysvipc/test-sysvsem.c 2021-09-18 21:03:05.314302356 +1000
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <errno.h>
@@ -5009,47 +6154,12 @@ index 01dbff343a..b7284e0b48 100644
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
-diff --git a/version.h b/version.h
-index 83cd196798..e6ca7a8857 100644
---- a/version.h
-+++ b/version.h
+diff -pruN glibc-2.32.orig/version.h glibc-2.32/version.h
+--- glibc-2.32.orig/version.h 2021-09-18 21:02:32.746186190 +1000
++++ glibc-2.32/version.h 2021-09-18 21:03:05.314302356 +1000
@@ -1,4 +1,4 @@
/* This file just defines the current version number of libc. */
-#define RELEASE "release"
+#define RELEASE "stable"
#define VERSION "2.32"
-diff --git a/sysdeps/unix/sysv/linux/x86_64/64/configure b/sysdeps/unix/sysv/linux/x86_64/64/configure
-index 9d298faba7..cef1ec842c 100644
---- a/sysdeps/unix/sysv/linux/x86_64/64/configure
-+++ b/sysdeps/unix/sysv/linux/x86_64/64/configure
-@@ -4,10 +4,10 @@
- test -n "$libc_cv_slibdir" ||
- case "$prefix" in
- /usr | /usr/)
-- libc_cv_slibdir='/lib64'
-- libc_cv_rtlddir='/lib64'
-+ libc_cv_slibdir='/lib'
-+ libc_cv_rtlddir='/lib'
- if test "$libdir" = '${exec_prefix}/lib'; then
-- libdir='${exec_prefix}/lib64';
-+ libdir='${exec_prefix}/lib';
- # Locale data can be shared between 32-bit and 64-bit libraries.
- libc_cv_complocaledir='${exec_prefix}/lib/locale'
- fi
-diff --git a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
-index 062c04689d..7783757726 100644
---- a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
-+++ b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
-@@ -18,9 +18,9 @@
- #include <sysdeps/generic/ldconfig.h>
-
- #define SYSDEP_KNOWN_INTERPRETER_NAMES \
-- { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
-+ { "/lib32/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
- { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \
-- { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
-+ { "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
- #define SYSDEP_KNOWN_LIBRARY_NAMES \
- { "libc.so.6", FLAG_ELF_LIBC6 }, \
- { "libm.so.6", FLAG_ELF_LIBC6 },
1
0
ports/core (3.6): [notify] glibc: fixed upstream bugs and CVE-2021-33574 denial of service (application crash) bug
by crux@crux.nu 18 Sep '21
by crux@crux.nu 18 Sep '21
18 Sep '21
commit 2d4cd0f65844495a17fb6694f9991fd43ba5c325
Author: Danny Rawlins <contact(a)romster.me>
Date: Sat Sep 18 23:23:53 2021 +1000
[notify] glibc: fixed upstream bugs and CVE-2021-33574 denial of service (application crash) bug
diff --git a/glibc/.signature b/glibc/.signature
index 0f951399..f0d0d455 100644
--- a/glibc/.signature
+++ b/glibc/.signature
@@ -1,10 +1,10 @@
untrusted comment: verify with /etc/ports/core.pub
-RWRJc1FUaeVeqjLke5N/nYqmPS8FTuYrMIMM+JcrMXi+8bYduM69nInINCD/9aHGE46XRhhs9VXDk9OSXGGgYh+0qi53F07DdwE=
-SHA256 (Pkgfile) = 9197d70016bdb5b75c53822a5949a397eda0feb038f59e7b2cfe3feef43eff1e
+RWRJc1FUaeVeqkRgbm9Tt3SQmNdovthr26upk4hKJQ4CQPSGukiLSmbpEZl3y+YG1MT4883f5lEsDs2fsDBSvRPBxj19tyXKhws=
+SHA256 (Pkgfile) = 83be9dd155cdb0c9e8ef7fcecdfafe55959214ac55f2b0f3c7875b9818481505
SHA256 (.footprint) = aa29daaba0d990bb954964b7605cf132588bcb5ee9cf56d219f2ed26e60eba7b
SHA256 (glibc-2.32.tar.xz) = 1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
SHA256 (linux-5.4.72.tar.xz) = 0e24645bd56fe5b55a7a662895f5562c103d71b54d097281f0c9c71ff22c1172
-SHA256 (glibc-2.32-4.patch) = 3c93822f91229e21fb718390fd41a0dd279032e80c878d2657d268e77f851202
+SHA256 (glibc-2.32-5.patch) = 195b66ab42fd8fa82119b720e0432faebac2087cd16943d230d4839e4d308dcf
SHA256 (hosts) = 5c02b256c105f1d4a12fb738d71c1bab9eb126533074d7a0c8a14b92670c9431
SHA256 (resolv.conf) = 72ccb58768a72a771ec37142bc361a18478a07ec9de6e925a20760794389bf51
SHA256 (nsswitch.conf) = 859b8984e5e90aff3cce8f9779996ae4033b280d2122840e9411e2f44a1c2e61
diff --git a/glibc/Pkgfile b/glibc/Pkgfile
index 2cbaf942..c6a6b4f3 100644
--- a/glibc/Pkgfile
+++ b/glibc/Pkgfile
@@ -4,10 +4,10 @@
name=glibc
version=2.32
-release=4
+release=5
source=(https://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz \
https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.72.tar.xz \
- glibc-$version-4.patch \
+ glibc-$version-5.patch \
hosts resolv.conf nsswitch.conf host.conf ld.so.conf)
build() {
@@ -18,7 +18,7 @@ build() {
make INSTALL_HDR_PATH=$PKG/usr headers_install
chown root:root $PKG/usr
- patch -p1 -d $SRC/$name-${version:0:4} -i $SRC/$name-$version-4.patch
+ patch -p1 -d $SRC/$name-${version:0:4} -i $SRC/$name-$version-5.patch
mkdir $SRC/build
cd $SRC/build
diff --git a/glibc/glibc-2.32-4.patch b/glibc/glibc-2.32-5.patch
similarity index 85%
rename from glibc/glibc-2.32-4.patch
rename to glibc/glibc-2.32-5.patch
index ea46dfbd..b08b1624 100644
--- a/glibc/glibc-2.32-4.patch
+++ b/glibc/glibc-2.32-5.patch
@@ -1,118 +1,7 @@
-diff --git a/NEWS b/NEWS
-index 485b8ddffa..2afe250ccf 100644
---- a/NEWS
-+++ b/NEWS
-@@ -5,6 +5,25 @@ See the end for copying conditions.
- Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
- using `glibc' in the "product" field.
-
-+The following bugs are resolved with this release:
-+
-+ [20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
-+ [26224] iconv hangs when converting some invalid inputs from several IBM
-+ character sets (CVE-2020-27618)
-+ [26534] libm.so 2.32 SIGILL in pow() due to FMA4 instruction on non-FMA4
-+ system
-+ [26555] string: strerrorname_np does not return the documented value
-+ [26600] Transaction ID collisions cause slow DNS lookups in getaddrinfo
-+ [26636] libc: 32-bit shmctl(IPC_INFO) crashes when shminfo struct is
-+ at the end of a memory mapping
-+ [26637] libc: semctl SEM_STAT_ANY fails to pass the buffer specified
-+ by the caller to the kernel
-+ [26639] libc: msgctl IPC_INFO and MSG_INFO return garbage
-+ [26853] aarch64: Missing unwind information in statically linked startup code
-+ [26932] libc: sh: Multiple floating point functions defined as stubs only
-+ [27130] "rep movsb" performance issue
-+ [27177] GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
-+
- Version 2.32
-
- Major new features:
-@@ -185,6 +204,14 @@ Security related changes:
- Dytrych of the Cisco Security Assessment and Penetration Team (See
- TALOS-2020-1019).
-
-+ CVE-2020-27618: An infinite loop has been fixed in the iconv program when
-+ invoked with input containing redundant shift sequences in the IBM1364,
-+ IBM1371, IBM1388, IBM1390, or IBM1399 character sets.
-+
-+ CVE-2021-33574: The mq_notify function has a potential use-after-free
-+ issue when using a notification type of SIGEV_THREAD and a thread
-+ attribute with a non-default affinity mask.
-+
- The following bugs are resolved with this release:
-
- [9809] localedata: ckb_IQ: new Kurdish Sorani locale
-diff --git a/Rules b/Rules
-index 8b771f6095..beab969fde 100644
---- a/Rules
-+++ b/Rules
-@@ -155,6 +155,7 @@ xtests: tests $(xtests-special)
- else
- tests: $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \
- $(tests-container:%=$(objpfx)%.out) \
-+ $(tests-mcheck:%=$(objpfx)%-mcheck.out) \
- $(tests-special) $(tests-printers-out)
- xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-special)
- endif
-@@ -165,7 +166,7 @@ ifeq ($(run-built-tests),no)
- tests-expected =
- else
- tests-expected = $(tests) $(tests-internal) $(tests-printers) \
-- $(tests-container)
-+ $(tests-container) $(tests-mcheck:%=%-mcheck)
- endif
- tests:
- $(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
-@@ -191,6 +192,7 @@ else
- binaries-pie-tests =
- binaries-pie-notests =
- endif
-+binaries-mcheck-tests = $(tests-mcheck:%=%-mcheck)
- else
- binaries-all-notests =
- binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs)
-@@ -200,6 +202,7 @@ binaries-static-tests =
- binaries-static =
- binaries-pie-tests =
- binaries-pie-notests =
-+binaries-mcheck-tests =
- endif
-
- binaries-pie = $(binaries-pie-tests) $(binaries-pie-notests)
-@@ -223,6 +226,14 @@ $(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
- $(+link-tests)
- endif
-
-+ifneq "$(strip $(binaries-mcheck-tests))" ""
-+$(addprefix $(objpfx),$(binaries-mcheck-tests)): %-mcheck: %.o \
-+ $(link-extra-libs-tests) \
-+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
-+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
-+ $(+link-tests)
-+endif
-+
- ifneq "$(strip $(binaries-pie-tests))" ""
- $(addprefix $(objpfx),$(binaries-pie-tests)): %: %.o \
- $(link-extra-libs-tests) \
-@@ -253,6 +264,12 @@ $(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
- $(+link-static-tests)
- endif
-
-+# All mcheck tests will be run with MALLOC_CHECK_=3
-+define mcheck-ENVS
-+$(1)-mcheck-ENV = MALLOC_CHECK_=3
-+endef
-+$(foreach t,$(tests-mcheck),$(eval $(call mcheck-ENVS,$(t))))
-+
- ifneq "$(strip $(tests) $(tests-internal) $(xtests) $(test-srcs))" ""
- # These are the implicit rules for making test outputs
- # from the test programs and whatever input files are present.
-diff --git a/debug/Makefile b/debug/Makefile
-index 3a60d7af7a..0036edd187 100644
---- a/debug/Makefile
-+++ b/debug/Makefile
-@@ -51,7 +51,7 @@ routines = backtrace backtracesyms backtracesymsfd noophooks \
+diff -pruN glibc-2.32.orig/debug/Makefile glibc-2.32/debug/Makefile
+--- glibc-2.32.orig/debug/Makefile 2021-09-18 21:02:32.642182626 +1000
++++ glibc-2.32/debug/Makefile 2021-09-18 21:03:05.310302219 +1000
+@@ -51,7 +51,7 @@ routines = backtrace backtracesyms back
explicit_bzero_chk \
stack_chk_fail fortify_fail \
$(static-only-routines)
@@ -121,11 +10,9 @@ index 3a60d7af7a..0036edd187 100644
# Don't add stack_chk_fail_local.o to libc.a since __stack_chk_fail_local
# is an alias of __stack_chk_fail in stack_chk_fail.o.
-diff --git a/debug/warning-nop.c b/debug/warning-nop.c
-deleted file mode 100644
-index 4ab7e182b7..0000000000
---- a/debug/warning-nop.c
-+++ /dev/null
+diff -pruN glibc-2.32.orig/debug/warning-nop.c glibc-2.32/debug/warning-nop.c
+--- glibc-2.32.orig/debug/warning-nop.c 2021-09-18 21:02:32.642182626 +1000
++++ glibc-2.32/debug/warning-nop.c 1970-01-01 10:00:00.000000000 +1000
@@ -1,70 +0,0 @@
-/* Dummy nop functions to elicit link-time warnings.
- Copyright (C) 2005-2020 Free Software Foundation, Inc.
@@ -197,33 +84,10 @@ index 4ab7e182b7..0000000000
-#define __builtin_object_size(bos, level) 0
-
-#include <string.h>
-diff --git a/elf/Makefile b/elf/Makefile
-index 0b78721848..3ba7f4ecfc 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -1381,6 +1381,8 @@ CFLAGS-ifuncmain7pie.c += $(pie-ccflag)
- CFLAGS-ifuncmain9pie.c += $(pie-ccflag)
- CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag)
-
-+LDFLAGS-ifuncmain6pie = -Wl,-z,lazy
-+
- $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so
- $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o
- $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so
-@@ -1630,8 +1632,6 @@ $(objpfx)tst-nodelete-dlclose.out: $(objpfx)tst-nodelete-dlclose-dso.so \
-
- tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \
- LD_HWCAP_MASK=0x1
--tst-env-setuid-tunables-ENV = \
-- GLIBC_TUNABLES=glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096
-
- $(objpfx)tst-debug1: $(libdl)
- $(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so
-diff --git a/elf/dl-load.c b/elf/dl-load.c
-index e39980fb19..71867e7c1a 100644
---- a/elf/dl-load.c
-+++ b/elf/dl-load.c
-@@ -855,10 +855,12 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
+diff -pruN glibc-2.32.orig/elf/dl-load.c glibc-2.32/elf/dl-load.c
+--- glibc-2.32.orig/elf/dl-load.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/dl-load.c 2021-09-18 21:03:05.311302253 +1000
+@@ -855,10 +855,12 @@ lose (int code, int fd, const char *name
/* Process PT_GNU_PROPERTY program header PH in module L after
PT_LOAD segments are mapped. Only one NT_GNU_PROPERTY_TYPE_0
@@ -238,7 +102,7 @@ index e39980fb19..71867e7c1a 100644
{
const ElfW(Nhdr) *note = (const void *) (ph->p_vaddr + l->l_addr);
const ElfW(Addr) size = ph->p_memsz;
-@@ -905,7 +907,7 @@ _dl_process_pt_gnu_property (struct link_map *l, const ElfW(Phdr) *ph)
+@@ -905,7 +907,7 @@ _dl_process_pt_gnu_property (struct link
last_type = type;
/* Target specific property processing. */
@@ -247,7 +111,7 @@ index e39980fb19..71867e7c1a 100644
return;
/* Check the next property item. */
-@@ -1251,21 +1253,6 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd,
+@@ -1251,21 +1253,6 @@ _dl_map_object_from_fd (const char *name
maplength, has_holes, loader);
if (__glibc_unlikely (errstring != NULL))
goto call_lose;
@@ -269,7 +133,7 @@ index e39980fb19..71867e7c1a 100644
}
if (l->l_ld == 0)
-@@ -1377,6 +1364,21 @@ cannot enable executable stack as shared object requires");
+@@ -1377,6 +1364,21 @@ cannot enable executable stack as shared
if (l->l_tls_initimage != NULL)
l->l_tls_initimage = (char *) l->l_tls_initimage + l->l_addr;
@@ -291,11 +155,10 @@ index e39980fb19..71867e7c1a 100644
/* We are done mapping in the file. We no longer need the descriptor. */
if (__glibc_unlikely (__close_nocancel (fd) != 0))
{
-diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
-index 26e6e26612..15b29bcb90 100644
---- a/elf/dl-tunables.c
-+++ b/elf/dl-tunables.c
-@@ -177,6 +177,7 @@ parse_tunables (char *tunestr, char *valstring)
+diff -pruN glibc-2.32.orig/elf/dl-tunables.c glibc-2.32/elf/dl-tunables.c
+--- glibc-2.32.orig/elf/dl-tunables.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/dl-tunables.c 2021-09-18 21:03:05.311302253 +1000
+@@ -177,6 +177,7 @@ parse_tunables (char *tunestr, char *val
return;
char *p = tunestr;
@@ -303,7 +166,7 @@ index 26e6e26612..15b29bcb90 100644
while (true)
{
-@@ -190,7 +191,11 @@ parse_tunables (char *tunestr, char *valstring)
+@@ -190,7 +191,11 @@ parse_tunables (char *tunestr, char *val
/* If we reach the end of the string before getting a valid name-value
pair, bail out. */
if (p[len] == '\0')
@@ -316,7 +179,7 @@ index 26e6e26612..15b29bcb90 100644
/* We did not find a valid name-value pair before encountering the
colon. */
-@@ -216,35 +221,28 @@ parse_tunables (char *tunestr, char *valstring)
+@@ -216,35 +221,28 @@ parse_tunables (char *tunestr, char *val
if (tunable_is_name (cur->name, name))
{
@@ -371,7 +234,7 @@ index 26e6e26612..15b29bcb90 100644
}
if (cur->security_level != TUNABLE_SECLEVEL_NONE)
-@@ -257,9 +255,7 @@ parse_tunables (char *tunestr, char *valstring)
+@@ -257,9 +255,7 @@ parse_tunables (char *tunestr, char *val
}
}
@@ -382,10 +245,9 @@ index 26e6e26612..15b29bcb90 100644
p += len + 1;
}
}
-diff --git a/elf/ifuncmain6pie.c b/elf/ifuncmain6pie.c
-index 04faeb86ef..4a01906836 100644
---- a/elf/ifuncmain6pie.c
-+++ b/elf/ifuncmain6pie.c
+diff -pruN glibc-2.32.orig/elf/ifuncmain6pie.c glibc-2.32/elf/ifuncmain6pie.c
+--- glibc-2.32.orig/elf/ifuncmain6pie.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/ifuncmain6pie.c 2021-09-18 21:03:05.311302253 +1000
@@ -9,7 +9,6 @@
#include "ifunc-sel.h"
@@ -431,10 +293,9 @@ index 04faeb86ef..4a01906836 100644
if (foo () != -30)
abort ();
-diff --git a/elf/ifuncmod6.c b/elf/ifuncmod6.c
-index 2e16c1d06d..2f6d0715e6 100644
---- a/elf/ifuncmod6.c
-+++ b/elf/ifuncmod6.c
+diff -pruN glibc-2.32.orig/elf/ifuncmod6.c glibc-2.32/elf/ifuncmod6.c
+--- glibc-2.32.orig/elf/ifuncmod6.c 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/ifuncmod6.c 2021-09-18 21:03:05.311302253 +1000
@@ -4,7 +4,7 @@ extern int foo (void);
typedef int (*foo_p) (void);
@@ -456,179 +317,46 @@ index 2e16c1d06d..2f6d0715e6 100644
- return foo;
+ return foo ();
}
-diff --git a/elf/rtld.c b/elf/rtld.c
-index 5b882163fa..14a42ed00a 100644
---- a/elf/rtld.c
-+++ b/elf/rtld.c
-@@ -1534,10 +1534,10 @@ of this helper program; chances are you did not intend to run this program.\n\
- switch (ph[-1].p_type)
- {
- case PT_NOTE:
-- _dl_process_pt_note (main_map, &ph[-1]);
-+ _dl_process_pt_note (main_map, -1, &ph[-1]);
- break;
- case PT_GNU_PROPERTY:
-- _dl_process_pt_gnu_property (main_map, &ph[-1]);
-+ _dl_process_pt_gnu_property (main_map, -1, &ph[-1]);
- break;
- }
-
-diff --git a/elf/tst-env-setuid-tunables.c b/elf/tst-env-setuid-tunables.c
-index 971d5892b1..ca0c8c245c 100644
---- a/elf/tst-env-setuid-tunables.c
-+++ b/elf/tst-env-setuid-tunables.c
-@@ -25,35 +25,76 @@
- #include "config.h"
- #undef _LIBC
+diff -pruN glibc-2.32.orig/elf/Makefile glibc-2.32/elf/Makefile
+--- glibc-2.32.orig/elf/Makefile 2021-09-18 21:02:32.643182660 +1000
++++ glibc-2.32/elf/Makefile 2021-09-18 21:03:05.311302253 +1000
+@@ -1381,6 +1381,8 @@ CFLAGS-ifuncmain7pie.c += $(pie-ccflag)
+ CFLAGS-ifuncmain9pie.c += $(pie-ccflag)
+ CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag)
--#define test_parent test_parent_tunables
--#define test_child test_child_tunables
--
--static int test_child_tunables (void);
--static int test_parent_tunables (void);
--
--#include "tst-env-setuid.c"
--
--#define CHILD_VALSTRING_VALUE "glibc.malloc.mmap_threshold=4096"
--#define PARENT_VALSTRING_VALUE \
-- "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096"
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <stdint.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <sys/stat.h>
-+#include <sys/wait.h>
-+#include <unistd.h>
-+#include <intprops.h>
-+#include <array_length.h>
-+
-+#include <support/check.h>
-+#include <support/support.h>
-+#include <support/test-driver.h>
-+#include <support/capture_subprocess.h>
-+
-+const char *teststrings[] =
-+{
-+ "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.check=2:glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096:glibc.malloc.check=2",
-+ "glibc.malloc.perturb=0x800",
-+ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.perturb=0x800:not_valid.malloc.check=2:glibc.malloc.mmap_threshold=4096",
-+ "glibc.not_valid.check=2:glibc.malloc.mmap_threshold=4096",
-+ "not_valid.malloc.check=2:glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.garbage=2:glibc.maoc.mmap_threshold=4096:glibc.malloc.check=2",
-+ "glibc.malloc.check=4:glibc.malloc.garbage=2:glibc.maoc.mmap_threshold=4096",
-+ ":glibc.malloc.garbage=2:glibc.malloc.check=1",
-+ "glibc.malloc.check=1:glibc.malloc.check=2",
-+ "not_valid.malloc.check=2",
-+ "glibc.not_valid.check=2",
-+};
++LDFLAGS-ifuncmain6pie = -Wl,-z,lazy
+
-+const char *resultstrings[] =
-+{
-+ "glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.perturb=0x800",
-+ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.mmap_threshold=4096",
-+ "glibc.malloc.mmap_threshold=4096",
-+ "",
-+ "",
-+ "",
-+ "",
-+ "",
-+ "",
-+};
-
- static int
--test_child_tunables (void)
-+test_child (int off)
- {
- const char *val = getenv ("GLIBC_TUNABLES");
-
- #if HAVE_TUNABLES
-- if (val != NULL && strcmp (val, CHILD_VALSTRING_VALUE) == 0)
-+ if (val != NULL && strcmp (val, resultstrings[off]) == 0)
- return 0;
-
- if (val != NULL)
-- printf ("Unexpected GLIBC_TUNABLES VALUE %s\n", val);
-+ printf ("[%d] Unexpected GLIBC_TUNABLES VALUE %s\n", off, val);
-
- return 1;
- #else
- if (val != NULL)
- {
-- printf ("GLIBC_TUNABLES not cleared\n");
-+ printf ("[%d] GLIBC_TUNABLES not cleared\n", off);
- return 1;
- }
- return 0;
-@@ -61,15 +102,48 @@ test_child_tunables (void)
- }
-
- static int
--test_parent_tunables (void)
-+do_test (int argc, char **argv)
- {
-- const char *val = getenv ("GLIBC_TUNABLES");
-+ /* Setgid child process. */
-+ if (argc == 2)
-+ {
-+ if (getgid () == getegid ())
-+ /* This can happen if the file system is mounted nosuid. */
-+ FAIL_UNSUPPORTED ("SGID failed: GID and EGID match (%jd)\n",
-+ (intmax_t) getgid ());
-
-- if (val != NULL && strcmp (val, PARENT_VALSTRING_VALUE) == 0)
-- return 0;
-+ int ret = test_child (atoi (argv[1]));
-
-- if (val != NULL)
-- printf ("Unexpected GLIBC_TUNABLES VALUE %s\n", val);
-+ if (ret != 0)
-+ exit (1);
+ $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so
+ $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o
+ $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so
+@@ -1630,8 +1632,6 @@ $(objpfx)tst-nodelete-dlclose.out: $(obj
-- return 1;
-+ exit (EXIT_SUCCESS);
-+ }
-+ else
-+ {
-+ int ret = 0;
-+
-+ /* Spawn tests. */
-+ for (int i = 0; i < array_length (teststrings); i++)
-+ {
-+ char buf[INT_BUFSIZE_BOUND (int)];
-+
-+ printf ("Spawned test for %s (%d)\n", teststrings[i], i);
-+ snprintf (buf, sizeof (buf), "%d\n", i);
-+ if (setenv ("GLIBC_TUNABLES", teststrings[i], 1) != 0)
-+ exit (1);
-+
-+ int status = support_capture_subprogram_self_sgid (buf);
-+
-+ /* Bail out early if unsupported. */
-+ if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
-+ return EXIT_UNSUPPORTED;
-+
-+ ret |= status;
-+ }
-+ return ret;
-+ }
- }
-+
-+#define TEST_FUNCTION_ARGV do_test
-+#include <support/test-driver.c>
-diff --git a/elf/tst-env-setuid.c b/elf/tst-env-setuid.c
-index 41dc79e83a..2dbccdb69e 100644
---- a/elf/tst-env-setuid.c
-+++ b/elf/tst-env-setuid.c
+ tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \
+ LD_HWCAP_MASK=0x1
+-tst-env-setuid-tunables-ENV = \
+- GLIBC_TUNABLES=glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096
+
+ $(objpfx)tst-debug1: $(libdl)
+ $(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so
+diff -pruN glibc-2.32.orig/elf/rtld.c glibc-2.32/elf/rtld.c
+--- glibc-2.32.orig/elf/rtld.c 2021-09-18 21:02:32.644182694 +1000
++++ glibc-2.32/elf/rtld.c 2021-09-18 21:03:05.311302253 +1000
+@@ -1534,10 +1534,10 @@ of this helper program; chances are you
+ switch (ph[-1].p_type)
+ {
+ case PT_NOTE:
+- _dl_process_pt_note (main_map, &ph[-1]);
++ _dl_process_pt_note (main_map, -1, &ph[-1]);
+ break;
+ case PT_GNU_PROPERTY:
+- _dl_process_pt_gnu_property (main_map, &ph[-1]);
++ _dl_process_pt_gnu_property (main_map, -1, &ph[-1]);
+ break;
+ }
+
+diff -pruN glibc-2.32.orig/elf/tst-env-setuid.c glibc-2.32/elf/tst-env-setuid.c
+--- glibc-2.32.orig/elf/tst-env-setuid.c 2021-09-18 21:02:32.644182694 +1000
++++ glibc-2.32/elf/tst-env-setuid.c 2021-09-18 21:03:05.311302253 +1000
@@ -29,173 +29,12 @@
#include <sys/wait.h>
#include <unistd.h>
@@ -858,25 +586,158 @@ index 41dc79e83a..2dbccdb69e 100644
}
#define TEST_FUNCTION_ARGV do_test
-diff --git a/iconv/Versions b/iconv/Versions
-index 8a5f4cf780..d51af52fa3 100644
---- a/iconv/Versions
-+++ b/iconv/Versions
-@@ -6,7 +6,9 @@ libc {
- GLIBC_PRIVATE {
- # functions shared with iconv program
- __gconv_get_alias_db; __gconv_get_cache; __gconv_get_modules_db;
-- __gconv_open; __gconv_create_spec;
+diff -pruN glibc-2.32.orig/elf/tst-env-setuid-tunables.c glibc-2.32/elf/tst-env-setuid-tunables.c
+--- glibc-2.32.orig/elf/tst-env-setuid-tunables.c 2021-09-18 21:02:32.644182694 +1000
++++ glibc-2.32/elf/tst-env-setuid-tunables.c 2021-09-18 21:03:05.311302253 +1000
+@@ -25,35 +25,76 @@
+ #include "config.h"
+ #undef _LIBC
+
+-#define test_parent test_parent_tunables
+-#define test_child test_child_tunables
++#include <errno.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <stdint.h>
++#include <stdio.h>
++#include <string.h>
++#include <sys/stat.h>
++#include <sys/wait.h>
++#include <unistd.h>
++#include <intprops.h>
++#include <array_length.h>
+
-+ # functions used elsewhere in glibc
-+ __gconv_open; __gconv_create_spec; __gconv_destroy_spec;
++#include <support/check.h>
++#include <support/support.h>
++#include <support/test-driver.h>
++#include <support/capture_subprocess.h>
- # function used by the gconv modules
- __gconv_transliterate;
-diff --git a/iconv/gconv_charset.c b/iconv/gconv_charset.c
-index 6ccd0773cc..4ba0aa99f5 100644
---- a/iconv/gconv_charset.c
-+++ b/iconv/gconv_charset.c
+-static int test_child_tunables (void);
+-static int test_parent_tunables (void);
+-
+-#include "tst-env-setuid.c"
++const char *teststrings[] =
++{
++ "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.check=2:glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096:glibc.malloc.check=2",
++ "glibc.malloc.perturb=0x800",
++ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.perturb=0x800:not_valid.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.not_valid.check=2:glibc.malloc.mmap_threshold=4096",
++ "not_valid.malloc.check=2:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.garbage=2:glibc.maoc.mmap_threshold=4096:glibc.malloc.check=2",
++ "glibc.malloc.check=4:glibc.malloc.garbage=2:glibc.maoc.mmap_threshold=4096",
++ ":glibc.malloc.garbage=2:glibc.malloc.check=1",
++ "glibc.malloc.check=1:glibc.malloc.check=2",
++ "not_valid.malloc.check=2",
++ "glibc.not_valid.check=2",
++};
+
+-#define CHILD_VALSTRING_VALUE "glibc.malloc.mmap_threshold=4096"
+-#define PARENT_VALSTRING_VALUE \
+- "glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096"
++const char *resultstrings[] =
++{
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.perturb=0x800",
++ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.perturb=0x800:glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "glibc.malloc.mmap_threshold=4096",
++ "",
++ "",
++ "",
++ "",
++ "",
++ "",
++};
+
+ static int
+-test_child_tunables (void)
++test_child (int off)
+ {
+ const char *val = getenv ("GLIBC_TUNABLES");
+
+ #if HAVE_TUNABLES
+- if (val != NULL && strcmp (val, CHILD_VALSTRING_VALUE) == 0)
++ if (val != NULL && strcmp (val, resultstrings[off]) == 0)
+ return 0;
+
+ if (val != NULL)
+- printf ("Unexpected GLIBC_TUNABLES VALUE %s\n", val);
++ printf ("[%d] Unexpected GLIBC_TUNABLES VALUE %s\n", off, val);
+
+ return 1;
+ #else
+ if (val != NULL)
+ {
+- printf ("GLIBC_TUNABLES not cleared\n");
++ printf ("[%d] GLIBC_TUNABLES not cleared\n", off);
+ return 1;
+ }
+ return 0;
+@@ -61,15 +102,48 @@ test_child_tunables (void)
+ }
+
+ static int
+-test_parent_tunables (void)
++do_test (int argc, char **argv)
+ {
+- const char *val = getenv ("GLIBC_TUNABLES");
++ /* Setgid child process. */
++ if (argc == 2)
++ {
++ if (getgid () == getegid ())
++ /* This can happen if the file system is mounted nosuid. */
++ FAIL_UNSUPPORTED ("SGID failed: GID and EGID match (%jd)\n",
++ (intmax_t) getgid ());
+
+- if (val != NULL && strcmp (val, PARENT_VALSTRING_VALUE) == 0)
+- return 0;
++ int ret = test_child (atoi (argv[1]));
+
+- if (val != NULL)
+- printf ("Unexpected GLIBC_TUNABLES VALUE %s\n", val);
++ if (ret != 0)
++ exit (1);
+
+- return 1;
++ exit (EXIT_SUCCESS);
++ }
++ else
++ {
++ int ret = 0;
++
++ /* Spawn tests. */
++ for (int i = 0; i < array_length (teststrings); i++)
++ {
++ char buf[INT_BUFSIZE_BOUND (int)];
++
++ printf ("Spawned test for %s (%d)\n", teststrings[i], i);
++ snprintf (buf, sizeof (buf), "%d\n", i);
++ if (setenv ("GLIBC_TUNABLES", teststrings[i], 1) != 0)
++ exit (1);
++
++ int status = support_capture_subprogram_self_sgid (buf);
++
++ /* Bail out early if unsupported. */
++ if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
++ return EXIT_UNSUPPORTED;
++
++ ret |= status;
++ }
++ return ret;
++ }
+ }
++
++#define TEST_FUNCTION_ARGV do_test
++#include <support/test-driver.c>
+diff -pruN glibc-2.32.orig/iconv/gconv_charset.c glibc-2.32/iconv/gconv_charset.c
+--- glibc-2.32.orig/iconv/gconv_charset.c 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/gconv_charset.c 2021-09-18 21:03:05.311302253 +1000
@@ -216,3 +216,13 @@ out:
return ret;
}
@@ -891,10 +752,9 @@ index 6ccd0773cc..4ba0aa99f5 100644
+ return;
+}
+libc_hidden_def (__gconv_destroy_spec)
-diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h
-index b39b09aea1..e9c122cf7e 100644
---- a/iconv/gconv_charset.h
-+++ b/iconv/gconv_charset.h
+diff -pruN glibc-2.32.orig/iconv/gconv_charset.h glibc-2.32/iconv/gconv_charset.h
+--- glibc-2.32.orig/iconv/gconv_charset.h 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/gconv_charset.h 2021-09-18 21:03:05.311302253 +1000
@@ -48,33 +48,6 @@
#define GCONV_IGNORE_ERRORS_SUFFIX "IGNORE"
@@ -929,11 +789,10 @@ index b39b09aea1..e9c122cf7e 100644
/* This function copies in-order, characters from the source 's' that are
either alpha-numeric or one in one of these: "_-.,:/" - into the destination
'wp' while dropping all other characters. In the process, it converts all
-diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h
-index e86938dae7..f721ce30ff 100644
---- a/iconv/gconv_int.h
-+++ b/iconv/gconv_int.h
-@@ -152,6 +152,27 @@ extern int __gconv_open (struct gconv_spec *conv_spec,
+diff -pruN glibc-2.32.orig/iconv/gconv_int.h glibc-2.32/iconv/gconv_int.h
+--- glibc-2.32.orig/iconv/gconv_int.h 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/gconv_int.h 2021-09-18 21:03:05.311302253 +1000
+@@ -152,6 +152,27 @@ extern int __gconv_open (struct gconv_sp
__gconv_t *handle, int flags);
libc_hidden_proto (__gconv_open)
@@ -961,11 +820,10 @@ index e86938dae7..f721ce30ff 100644
/* Free resources associated with transformation descriptor CD. */
extern int __gconv_close (__gconv_t cd)
attribute_hidden;
-diff --git a/iconv/iconv_open.c b/iconv/iconv_open.c
-index dd54bc12e0..5b30055c04 100644
---- a/iconv/iconv_open.c
-+++ b/iconv/iconv_open.c
-@@ -39,7 +39,7 @@ iconv_open (const char *tocode, const char *fromcode)
+diff -pruN glibc-2.32.orig/iconv/iconv_open.c glibc-2.32/iconv/iconv_open.c
+--- glibc-2.32.orig/iconv/iconv_open.c 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/iconv_open.c 2021-09-18 21:03:05.311302253 +1000
+@@ -39,7 +39,7 @@ iconv_open (const char *tocode, const ch
int res = __gconv_open (&conv_spec, &cd, 0);
@@ -974,10 +832,9 @@ index dd54bc12e0..5b30055c04 100644
if (__builtin_expect (res, __GCONV_OK) != __GCONV_OK)
{
-diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
-index b4334faa57..d59979759c 100644
---- a/iconv/iconv_prog.c
-+++ b/iconv/iconv_prog.c
+diff -pruN glibc-2.32.orig/iconv/iconv_prog.c glibc-2.32/iconv/iconv_prog.c
+--- glibc-2.32.orig/iconv/iconv_prog.c 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/iconv_prog.c 2021-09-18 21:03:05.311302253 +1000
@@ -184,7 +184,7 @@ main (int argc, char *argv[])
/* Let's see whether we have these coded character sets. */
res = __gconv_open (&conv_spec, &cd, 0);
@@ -987,10 +844,9 @@ index b4334faa57..d59979759c 100644
if (res != __GCONV_OK)
{
-diff --git a/iconv/tst-iconv_prog.sh b/iconv/tst-iconv_prog.sh
-index 8298136b7f..d8db7b335c 100644
---- a/iconv/tst-iconv_prog.sh
-+++ b/iconv/tst-iconv_prog.sh
+diff -pruN glibc-2.32.orig/iconv/tst-iconv_prog.sh glibc-2.32/iconv/tst-iconv_prog.sh
+--- glibc-2.32.orig/iconv/tst-iconv_prog.sh 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/tst-iconv_prog.sh 2021-09-18 21:03:05.311302253 +1000
@@ -102,12 +102,16 @@ hangarray=(
"\x00\x80;-c;IBM1161;UTF-8//TRANSLIT//IGNORE"
"\x00\xdb;-c;IBM1162;UTF-8//TRANSLIT//IGNORE"
@@ -1014,34 +870,23 @@ index 8298136b7f..d8db7b335c 100644
"\x00\x53;-c;IBM16804;UTF-8//TRANSLIT//IGNORE"
"\x00\x41;-c;IBM274;UTF-8//TRANSLIT//IGNORE"
"\x00\x41;-c;IBM275;UTF-8//TRANSLIT//IGNORE"
-diff --git a/iconvdata/Makefile b/iconvdata/Makefile
-index 4ec2741cdc..4eef07557e 100644
---- a/iconvdata/Makefile
-+++ b/iconvdata/Makefile
-@@ -73,7 +73,8 @@ modules.so := $(addsuffix .so, $(modules))
- ifeq (yes,$(build-shared))
- tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
- tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
-- bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4
-+ bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
-+ bug-iconv13 bug-iconv14
- ifeq ($(have-thread-library),yes)
- tests += bug-iconv3
- endif
-@@ -321,6 +322,8 @@ $(objpfx)bug-iconv10.out: $(objpfx)gconv-modules \
- $(addprefix $(objpfx),$(modules.so))
- $(objpfx)bug-iconv12.out: $(objpfx)gconv-modules \
- $(addprefix $(objpfx),$(modules.so))
-+$(objpfx)bug-iconv14.out: $(objpfx)gconv-modules \
-+ $(addprefix $(objpfx),$(modules.so))
+diff -pruN glibc-2.32.orig/iconv/Versions glibc-2.32/iconv/Versions
+--- glibc-2.32.orig/iconv/Versions 2021-09-18 21:02:32.646182763 +1000
++++ glibc-2.32/iconv/Versions 2021-09-18 21:03:05.311302253 +1000
+@@ -6,7 +6,9 @@ libc {
+ GLIBC_PRIVATE {
+ # functions shared with iconv program
+ __gconv_get_alias_db; __gconv_get_cache; __gconv_get_modules_db;
+- __gconv_open; __gconv_create_spec;
++
++ # functions used elsewhere in glibc
++ __gconv_open; __gconv_create_spec; __gconv_destroy_spec;
- $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
- $(addprefix $(objpfx),$(modules.so)) \
-diff --git a/iconvdata/bug-iconv13.c b/iconvdata/bug-iconv13.c
-new file mode 100644
-index 0000000000..87aaff398e
---- /dev/null
-+++ b/iconvdata/bug-iconv13.c
+ # function used by the gconv modules
+ __gconv_transliterate;
+diff -pruN glibc-2.32.orig/iconvdata/bug-iconv13.c glibc-2.32/iconvdata/bug-iconv13.c
+--- glibc-2.32.orig/iconvdata/bug-iconv13.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/iconvdata/bug-iconv13.c 2021-09-18 21:03:05.311302253 +1000
@@ -0,0 +1,53 @@
+/* bug 24973: Test EUC-KR module
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -1096,11 +941,9 @@ index 0000000000..87aaff398e
+}
+
+#include <support/test-driver.c>
-diff --git a/iconvdata/bug-iconv14.c b/iconvdata/bug-iconv14.c
-new file mode 100644
-index 0000000000..902f140fa9
---- /dev/null
-+++ b/iconvdata/bug-iconv14.c
+diff -pruN glibc-2.32.orig/iconvdata/bug-iconv14.c glibc-2.32/iconvdata/bug-iconv14.c
+--- glibc-2.32.orig/iconvdata/bug-iconv14.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/iconvdata/bug-iconv14.c 2021-09-18 21:03:05.311302253 +1000
@@ -0,0 +1,127 @@
+/* Assertion in ISO-2022-JP-3 due to two-character sequence (bug 27256).
+ Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1229,11 +1072,10 @@ index 0000000000..902f140fa9
+}
+
+#include <support/test-driver.c>
-diff --git a/iconvdata/euc-kr.c b/iconvdata/euc-kr.c
-index b0d56cf3ee..1045bae926 100644
---- a/iconvdata/euc-kr.c
-+++ b/iconvdata/euc-kr.c
-@@ -80,11 +80,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
+diff -pruN glibc-2.32.orig/iconvdata/euc-kr.c glibc-2.32/iconvdata/euc-kr.c
+--- glibc-2.32.orig/iconvdata/euc-kr.c 2021-09-18 21:02:32.648182831 +1000
++++ glibc-2.32/iconvdata/euc-kr.c 2021-09-18 21:03:05.311302253 +1000
+@@ -80,11 +80,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned c
\
if (ch <= 0x9f) \
++inptr; \
@@ -1246,10 +1088,9 @@ index b0d56cf3ee..1045bae926 100644
{ \
/* This is illegal. */ \
STANDARD_FROM_LOOP_ERR_HANDLER (1); \
-diff --git a/iconvdata/ibm1364.c b/iconvdata/ibm1364.c
-index 49e7267ab4..521f0825b7 100644
---- a/iconvdata/ibm1364.c
-+++ b/iconvdata/ibm1364.c
+diff -pruN glibc-2.32.orig/iconvdata/ibm1364.c glibc-2.32/iconvdata/ibm1364.c
+--- glibc-2.32.orig/iconvdata/ibm1364.c 2021-09-18 21:02:32.649182866 +1000
++++ glibc-2.32/iconvdata/ibm1364.c 2021-09-18 21:03:05.311302253 +1000
@@ -158,24 +158,14 @@ enum
\
if (__builtin_expect (ch, 0) == SO) \
@@ -1277,10 +1118,9 @@ index 49e7267ab4..521f0825b7 100644
curcs = sb; \
++inptr; \
continue; \
-diff --git a/iconvdata/iso-2022-jp-3.c b/iconvdata/iso-2022-jp-3.c
-index 8c3b7e627e..62cbc54a11 100644
---- a/iconvdata/iso-2022-jp-3.c
-+++ b/iconvdata/iso-2022-jp-3.c
+diff -pruN glibc-2.32.orig/iconvdata/iso-2022-jp-3.c glibc-2.32/iconvdata/iso-2022-jp-3.c
+--- glibc-2.32.orig/iconvdata/iso-2022-jp-3.c 2021-09-18 21:02:32.651182934 +1000
++++ glibc-2.32/iconvdata/iso-2022-jp-3.c 2021-09-18 21:03:05.311302253 +1000
@@ -67,23 +67,34 @@ enum
CURRENT_SEL_MASK = 7 << 3
};
@@ -1383,11 +1223,10 @@ index 8c3b7e627e..62cbc54a11 100644
} \
\
inptr += 2; \
-diff --git a/iconvdata/ksc5601.h b/iconvdata/ksc5601.h
-index d3eb3a4ff8..f5cdc72797 100644
---- a/iconvdata/ksc5601.h
-+++ b/iconvdata/ksc5601.h
-@@ -50,15 +50,15 @@ ksc5601_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)
+diff -pruN glibc-2.32.orig/iconvdata/ksc5601.h glibc-2.32/iconvdata/ksc5601.h
+--- glibc-2.32.orig/iconvdata/ksc5601.h 2021-09-18 21:02:32.652182968 +1000
++++ glibc-2.32/iconvdata/ksc5601.h 2021-09-18 21:03:05.311302253 +1000
+@@ -50,15 +50,15 @@ ksc5601_to_ucs4 (const unsigned char **s
unsigned char ch2;
int idx;
@@ -1406,11 +1245,32 @@ index d3eb3a4ff8..f5cdc72797 100644
ch2 = (*s)[1];
if (ch2 < offset || (ch2 - offset) <= 0x20 || (ch2 - offset) >= 0x7f)
return __UNKNOWN_10646_CHAR;
-diff --git a/intl/dcigettext.c b/intl/dcigettext.c
-index 2e7c662bc7..bd332e71da 100644
---- a/intl/dcigettext.c
-+++ b/intl/dcigettext.c
-@@ -1120,15 +1120,18 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
+diff -pruN glibc-2.32.orig/iconvdata/Makefile glibc-2.32/iconvdata/Makefile
+--- glibc-2.32.orig/iconvdata/Makefile 2021-09-18 21:02:32.647182797 +1000
++++ glibc-2.32/iconvdata/Makefile 2021-09-18 21:03:05.311302253 +1000
+@@ -73,7 +73,8 @@ modules.so := $(addsuffix .so, $(modules
+ ifeq (yes,$(build-shared))
+ tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
+ tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
+- bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4
++ bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
++ bug-iconv13 bug-iconv14
+ ifeq ($(have-thread-library),yes)
+ tests += bug-iconv3
+ endif
+@@ -321,6 +322,8 @@ $(objpfx)bug-iconv10.out: $(objpfx)gconv
+ $(addprefix $(objpfx),$(modules.so))
+ $(objpfx)bug-iconv12.out: $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so))
++$(objpfx)bug-iconv14.out: $(objpfx)gconv-modules \
++ $(addprefix $(objpfx),$(modules.so))
+
+ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so)) \
+diff -pruN glibc-2.32.orig/intl/dcigettext.c glibc-2.32/intl/dcigettext.c
+--- glibc-2.32.orig/intl/dcigettext.c 2021-09-18 21:02:32.656183106 +1000
++++ glibc-2.32/intl/dcigettext.c 2021-09-18 21:03:05.311302253 +1000
+@@ -1120,15 +1120,18 @@ _nl_find_msg (struct loaded_l10nfile *do
# ifdef _LIBC
@@ -1436,10 +1296,9 @@ index 2e7c662bc7..bd332e71da 100644
if (__builtin_expect (r != __GCONV_OK, 0))
{
/* If the output encoding is the same there is
-diff --git a/intl/tst-codeset.c b/intl/tst-codeset.c
-index fd70432eca..e9f6e5e09f 100644
---- a/intl/tst-codeset.c
-+++ b/intl/tst-codeset.c
+diff -pruN glibc-2.32.orig/intl/tst-codeset.c glibc-2.32/intl/tst-codeset.c
+--- glibc-2.32.orig/intl/tst-codeset.c 2021-09-18 21:02:32.656183106 +1000
++++ glibc-2.32/intl/tst-codeset.c 2021-09-18 21:03:05.311302253 +1000
@@ -22,13 +22,11 @@
#include <stdio.h>
#include <stdlib.h>
@@ -1478,8 +1337,6 @@ index fd70432eca..e9f6e5e09f 100644
- printf ("call 2 returned: %s\n", s);
- result = 1;
- }
--
-- return result;
+ /* `a with umlaut' is transliterated to `ae'. */
+ bind_textdomain_codeset ("codeset", "ASCII//TRANSLIT");
+ TEST_COMPARE_STRING (gettext ("cheese"), "Kaese");
@@ -1487,17 +1344,17 @@ index fd70432eca..e9f6e5e09f 100644
+ /* Transliteration also works by default even if not set. */
+ bind_textdomain_codeset ("codeset", "ASCII");
+ TEST_COMPARE_STRING (gettext ("cheese"), "Kaese");
-+
+
+- return result;
+ return 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
-diff --git a/malloc/Makefile b/malloc/Makefile
-index e22cbde22d..5093e8730e 100644
---- a/malloc/Makefile
-+++ b/malloc/Makefile
+diff -pruN glibc-2.32.orig/malloc/Makefile glibc-2.32/malloc/Makefile
+--- glibc-2.32.orig/malloc/Makefile 2021-09-18 21:02:32.670183585 +1000
++++ glibc-2.32/malloc/Makefile 2021-09-18 21:03:05.312302287 +1000
@@ -62,6 +62,16 @@ endif
tests += $(tests-static)
test-srcs = tst-mtrace
@@ -1515,7 +1372,7 @@ index e22cbde22d..5093e8730e 100644
routines = malloc morecore mcheck mtrace obstack reallocarray \
scratch_buffer_grow scratch_buffer_grow_preserve \
scratch_buffer_set_array_size \
-@@ -100,6 +110,11 @@ $(objpfx)tst-malloc-thread-exit: $(shared-thread-library)
+@@ -100,6 +110,11 @@ $(objpfx)tst-malloc-thread-exit: $(share
$(objpfx)tst-malloc-thread-fail: $(shared-thread-library)
$(objpfx)tst-malloc-fork-deadlock: $(shared-thread-library)
$(objpfx)tst-malloc-stats-cancellation: $(shared-thread-library)
@@ -1527,7 +1384,7 @@ index e22cbde22d..5093e8730e 100644
# Export the __malloc_initialize_hook variable to libc.so.
LDFLAGS-tst-mallocstate = -rdynamic
-@@ -239,6 +254,8 @@ $(tests:%=$(objpfx)%.o): CPPFLAGS += -DTEST_NO_MALLOPT
+@@ -239,6 +254,8 @@ $(tests:%=$(objpfx)%.o): CPPFLAGS += -DT
$(objpfx)tst-interpose-nothread: $(objpfx)tst-interpose-aux-nothread.o
$(objpfx)tst-interpose-thread: \
$(objpfx)tst-interpose-aux-thread.o $(shared-thread-library)
@@ -1536,18 +1393,17 @@ index e22cbde22d..5093e8730e 100644
$(objpfx)tst-interpose-static-nothread: $(objpfx)tst-interpose-aux-nothread.o
$(objpfx)tst-interpose-static-thread: \
$(objpfx)tst-interpose-aux-thread.o $(static-thread-library)
-@@ -256,3 +273,6 @@ $(objpfx)tst-dynarray-fail-mem.out: $(objpfx)tst-dynarray-fail.out
+@@ -256,3 +273,6 @@ $(objpfx)tst-dynarray-fail-mem.out: $(ob
$(objpfx)tst-malloc-tcache-leak: $(shared-thread-library)
$(objpfx)tst-malloc_info: $(shared-thread-library)
$(objpfx)tst-mallocfork2: $(shared-thread-library)
+$(objpfx)tst-malloc-tcache-leak-mcheck: $(shared-thread-library)
+$(objpfx)tst-malloc_info-mcheck: $(shared-thread-library)
+$(objpfx)tst-mallocfork2-mcheck: $(shared-thread-library)
-diff --git a/manual/tunables.texi b/manual/tunables.texi
-index 23ef0d40e7..d72d7a5ec0 100644
---- a/manual/tunables.texi
-+++ b/manual/tunables.texi
-@@ -432,7 +432,11 @@ set shared cache size in bytes for use in memory and string routines.
+diff -pruN glibc-2.32.orig/manual/tunables.texi glibc-2.32/manual/tunables.texi
+--- glibc-2.32.orig/manual/tunables.texi 2021-09-18 21:02:32.672183654 +1000
++++ glibc-2.32/manual/tunables.texi 2021-09-18 21:03:05.312302287 +1000
+@@ -432,7 +432,11 @@ set shared cache size in bytes for use i
@deftp Tunable glibc.cpu.x86_non_temporal_threshold
The @code{glibc.cpu.x86_non_temporal_threshold} tunable allows the user
@@ -1560,29 +1416,79 @@ index 23ef0d40e7..d72d7a5ec0 100644
This tunable is specific to i386 and x86-64.
@end deftp
-diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
-index 19d9cc5cfe..38221d0b2a 100644
---- a/misc/sys/cdefs.h
-+++ b/misc/sys/cdefs.h
+diff -pruN glibc-2.32.orig/misc/sys/cdefs.h glibc-2.32/misc/sys/cdefs.h
+--- glibc-2.32.orig/misc/sys/cdefs.h 2021-09-18 21:02:32.690184271 +1000
++++ glibc-2.32/misc/sys/cdefs.h 2021-09-18 21:03:05.312302287 +1000
@@ -124,13 +124,10 @@
#define __bos0(ptr) __builtin_object_size (ptr, 0)
- #if __GNUC_PREREQ (4,3)
--# define __warndecl(name, msg) \
-- extern void name (void) __attribute__((__warning__ (msg)))
- # define __warnattr(msg) __attribute__((__warning__ (msg)))
- # define __errordecl(name, msg) \
- extern void name (void) __attribute__((__error__ (msg)))
- #else
--# define __warndecl(name, msg) extern void name (void)
- # define __warnattr(msg)
- # define __errordecl(name, msg) extern void name (void)
- #endif
-diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
-index 88c69d1e9c..381aa721ef 100644
---- a/nscd/netgroupcache.c
-+++ b/nscd/netgroupcache.c
-@@ -248,7 +248,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
+ #if __GNUC_PREREQ (4,3)
+-# define __warndecl(name, msg) \
+- extern void name (void) __attribute__((__warning__ (msg)))
+ # define __warnattr(msg) __attribute__((__warning__ (msg)))
+ # define __errordecl(name, msg) \
+ extern void name (void) __attribute__((__error__ (msg)))
+ #else
+-# define __warndecl(name, msg) extern void name (void)
+ # define __warnattr(msg)
+ # define __errordecl(name, msg) extern void name (void)
+ #endif
+diff -pruN glibc-2.32.orig/NEWS glibc-2.32/NEWS
+--- glibc-2.32.orig/NEWS 2021-09-18 21:02:32.639182523 +1000
++++ glibc-2.32/NEWS 2021-09-18 21:30:11.284117111 +1000
+@@ -5,6 +5,33 @@ See the end for copying conditions.
+ Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
+ using `glibc' in the "product" field.
+
++The following bugs are resolved with this release:
++
++ [20019] NULL pointer dereference in libc.so.6 IFUNC due to uninitialized GOT
++ [25399] Remove __warn_memset_zero_len
++ [26224] iconv hangs when converting some invalid inputs from several IBM
++ character sets (CVE-2020-27618)
++ [26534] libm.so 2.32 SIGILL in pow() due to FMA4 instruction on non-FMA4
++ system
++ [26555] string: strerrorname_np does not return the documented value
++ [26600] Transaction ID collisions cause slow DNS lookups in getaddrinfo
++ [26636] libc: 32-bit shmctl(IPC_INFO) crashes when shminfo struct is
++ at the end of a memory mapping
++ [26637] libc: semctl SEM_STAT_ANY fails to pass the buffer specified
++ by the caller to the kernel
++ [26639] libc: msgctl IPC_INFO and MSG_INFO return garbage
++ [26690] __vfscanf_internal: fix aliasing violation
++ [26853] aarch64: Missing unwind information in statically linked startup code
++ [26932] libc: sh: Multiple floating point functions defined as stubs only
++ [27024] posix: Correct attribute access mode on readlinkat
++ [27130] "rep movsb" performance issue
++ [27177] GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
++ [27256] gconv: Fix assertion failure in ISO-2022-JP-3 module
++ [27462] nscd: Fix double free in netgroupcache
++ [27471] Fix SXID_ERASE behavior in setuid programs
++ [27896] Use __pthread_attr_copy in mq_notify (CVE-2021-33574)
++ [28213] librt: fix NULL pointer dereference
++
+ Version 2.32
+
+ Major new features:
+@@ -185,6 +212,14 @@ Security related changes:
+ Dytrych of the Cisco Security Assessment and Penetration Team (See
+ TALOS-2020-1019).
+
++ CVE-2020-27618: An infinite loop has been fixed in the iconv program when
++ invoked with input containing redundant shift sequences in the IBM1364,
++ IBM1371, IBM1388, IBM1390, or IBM1399 character sets.
++
++ CVE-2021-33574: The mq_notify function has a potential use-after-free
++ issue when using a notification type of SIGEV_THREAD and a thread
++ attribute with a non-default affinity mask.
++
+ The following bugs are resolved with this release:
+
+ [9809] localedata: ckb_IQ: new Kurdish Sorani locale
+diff -pruN glibc-2.32.orig/nscd/netgroupcache.c glibc-2.32/nscd/netgroupcache.c
+--- glibc-2.32.orig/nscd/netgroupcache.c 2021-09-18 21:02:32.692184339 +1000
++++ glibc-2.32/nscd/netgroupcache.c 2021-09-18 21:03:05.312302287 +1000
+@@ -248,7 +248,7 @@ addgetnetgrentX (struct database_dyn *db
: NULL);
ndomain = (ndomain ? newbuf + ndomaindiff
: NULL);
@@ -1591,7 +1497,7 @@ index 88c69d1e9c..381aa721ef 100644
}
nhost = memcpy (buffer + bufused,
-@@ -319,7 +319,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
+@@ -319,7 +319,7 @@ addgetnetgrentX (struct database_dyn *db
else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE)
{
buflen *= 2;
@@ -1600,22 +1506,21 @@ index 88c69d1e9c..381aa721ef 100644
}
else if (status == NSS_STATUS_RETURN
|| status == NSS_STATUS_NOTFOUND
-diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c
-index ed1b22308e..cb3f989cba 100644
---- a/posix/wordexp-test.c
-+++ b/posix/wordexp-test.c
-@@ -183,6 +183,7 @@ struct test_case_struct
- { 0, NULL, "$var", 0, 0, { NULL, }, IFS },
- { 0, NULL, "\"\\n\"", 0, 1, { "\\n", }, IFS },
- { 0, NULL, "", 0, 0, { NULL, }, IFS },
-+ { 0, NULL, "${1234567890123456789012}", 0, 0, { NULL, }, IFS },
-
- /* Flags not already covered (testit() has special handling for these) */
- { 0, NULL, "one two", WRDE_DOOFFS, 2, { "one", "two", }, IFS },
-diff --git a/posix/wordexp.c b/posix/wordexp.c
-index e082d94895..56289503a1 100644
---- a/posix/wordexp.c
-+++ b/posix/wordexp.c
+diff -pruN glibc-2.32.orig/posix/unistd.h glibc-2.32/posix/unistd.h
+--- glibc-2.32.orig/posix/unistd.h 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/posix/unistd.h 2021-09-18 21:04:13.411636170 +1000
+@@ -831,7 +831,7 @@ extern int symlinkat (const char *__from
+ /* Like readlink but a relative PATH is interpreted relative to FD. */
+ extern ssize_t readlinkat (int __fd, const char *__restrict __path,
+ char *__restrict __buf, size_t __len)
+- __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 4));
++ __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4));
+ #endif
+
+ /* Remove the link NAME. */
+diff -pruN glibc-2.32.orig/posix/wordexp.c glibc-2.32/posix/wordexp.c
+--- glibc-2.32.orig/posix/wordexp.c 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/posix/wordexp.c 2021-09-18 21:03:05.312302287 +1000
@@ -1399,7 +1399,7 @@ envsubst:
/* Is it a numeric parameter? */
else if (isdigit (env[0]))
@@ -1625,10 +1530,20 @@ index e082d94895..56289503a1 100644
if (n >= __libc_argc)
/* Substitute NULL. */
-diff --git a/resolv/Makefile b/resolv/Makefile
-index b61c0c3e0c..dbd8f8bf4f 100644
---- a/resolv/Makefile
-+++ b/resolv/Makefile
+diff -pruN glibc-2.32.orig/posix/wordexp-test.c glibc-2.32/posix/wordexp-test.c
+--- glibc-2.32.orig/posix/wordexp-test.c 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/posix/wordexp-test.c 2021-09-18 21:03:05.312302287 +1000
+@@ -183,6 +183,7 @@ struct test_case_struct
+ { 0, NULL, "$var", 0, 0, { NULL, }, IFS },
+ { 0, NULL, "\"\\n\"", 0, 1, { "\\n", }, IFS },
+ { 0, NULL, "", 0, 0, { NULL, }, IFS },
++ { 0, NULL, "${1234567890123456789012}", 0, 0, { NULL, }, IFS },
+
+ /* Flags not already covered (testit() has special handling for these) */
+ { 0, NULL, "one two", WRDE_DOOFFS, 2, { "one", "two", }, IFS },
+diff -pruN glibc-2.32.orig/resolv/Makefile glibc-2.32/resolv/Makefile
+--- glibc-2.32.orig/resolv/Makefile 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/resolv/Makefile 2021-09-18 21:03:05.312302287 +1000
@@ -61,6 +61,11 @@ tests += \
tst-resolv-search \
tst-resolv-trailing \
@@ -1641,7 +1556,7 @@ index b61c0c3e0c..dbd8f8bf4f 100644
# These tests need libdl.
ifeq (yes,$(build-shared))
tests += \
-@@ -191,6 +196,8 @@ $(objpfx)tst-resolv-search: $(objpfx)libresolv.so $(shared-thread-library)
+@@ -191,6 +196,8 @@ $(objpfx)tst-resolv-search: $(objpfx)lib
$(objpfx)tst-resolv-trailing: $(objpfx)libresolv.so $(shared-thread-library)
$(objpfx)tst-resolv-threads: \
$(libdl) $(objpfx)libresolv.so $(shared-thread-library)
@@ -1650,10 +1565,9 @@ index b61c0c3e0c..dbd8f8bf4f 100644
$(objpfx)tst-resolv-canonname: \
$(libdl) $(objpfx)libresolv.so $(shared-thread-library)
$(objpfx)tst-resolv-trustad: $(objpfx)libresolv.so $(shared-thread-library)
-diff --git a/resolv/res_send.c b/resolv/res_send.c
-index 7e5fec6646..70e5066031 100644
---- a/resolv/res_send.c
-+++ b/resolv/res_send.c
+diff -pruN glibc-2.32.orig/resolv/res_send.c glibc-2.32/resolv/res_send.c
+--- glibc-2.32.orig/resolv/res_send.c 2021-09-18 21:02:32.696184476 +1000
++++ glibc-2.32/resolv/res_send.c 2021-09-18 21:03:05.312302287 +1000
@@ -1342,15 +1342,6 @@ send_dg(res_state statp,
*terrno = EMSGSIZE;
return close_and_return_error (statp, resplen2);
@@ -1722,11 +1636,9 @@ index 7e5fec6646..70e5066031 100644
recvresp1 = 1;
else
recvresp2 = 1;
-diff --git a/resolv/tst-resolv-txnid-collision.c b/resolv/tst-resolv-txnid-collision.c
-new file mode 100644
-index 0000000000..189b76f126
---- /dev/null
-+++ b/resolv/tst-resolv-txnid-collision.c
+diff -pruN glibc-2.32.orig/resolv/tst-resolv-txnid-collision.c glibc-2.32/resolv/tst-resolv-txnid-collision.c
+--- glibc-2.32.orig/resolv/tst-resolv-txnid-collision.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/resolv/tst-resolv-txnid-collision.c 2021-09-18 21:03:05.312302287 +1000
@@ -0,0 +1,334 @@
+/* Test parallel queries with transaction ID collisions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -2062,24 +1974,73 @@ index 0000000000..189b76f126
+}
+
+#include <support/test-driver.c>
-diff --git a/stdio-common/Makefile b/stdio-common/Makefile
-index 8475fd1f09..eff0c98d82 100644
---- a/stdio-common/Makefile
-+++ b/stdio-common/Makefile
-@@ -69,7 +69,8 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
- tst-printf-bz25691 \
- tst-vfprintf-width-prec-alloc \
- tst-printf-fp-free \
-- tst-printf-fp-leak
-+ tst-printf-fp-leak \
-+ test-strerr
+diff -pruN glibc-2.32.orig/Rules glibc-2.32/Rules
+--- glibc-2.32.orig/Rules 2021-09-18 21:02:32.639182523 +1000
++++ glibc-2.32/Rules 2021-09-18 21:03:05.310302219 +1000
+@@ -155,6 +155,7 @@ xtests: tests $(xtests-special)
+ else
+ tests: $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \
+ $(tests-container:%=$(objpfx)%.out) \
++ $(tests-mcheck:%=$(objpfx)%-mcheck.out) \
+ $(tests-special) $(tests-printers-out)
+ xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-special)
+ endif
+@@ -165,7 +166,7 @@ ifeq ($(run-built-tests),no)
+ tests-expected =
+ else
+ tests-expected = $(tests) $(tests-internal) $(tests-printers) \
+- $(tests-container)
++ $(tests-container) $(tests-mcheck:%=%-mcheck)
+ endif
+ tests:
+ $(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
+@@ -191,6 +192,7 @@ else
+ binaries-pie-tests =
+ binaries-pie-notests =
+ endif
++binaries-mcheck-tests = $(tests-mcheck:%=%-mcheck)
+ else
+ binaries-all-notests =
+ binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs)
+@@ -200,6 +202,7 @@ binaries-static-tests =
+ binaries-static =
+ binaries-pie-tests =
+ binaries-pie-notests =
++binaries-mcheck-tests =
+ endif
+ binaries-pie = $(binaries-pie-tests) $(binaries-pie-notests)
+@@ -223,6 +226,14 @@ $(addprefix $(objpfx),$(binaries-shared-
+ $(+link-tests)
+ endif
- test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble
-diff --git a/stdio-common/errlist.c b/stdio-common/errlist.c
-index d15f13a22a..2ecf121674 100644
---- a/stdio-common/errlist.c
-+++ b/stdio-common/errlist.c
++ifneq "$(strip $(binaries-mcheck-tests))" ""
++$(addprefix $(objpfx),$(binaries-mcheck-tests)): %-mcheck: %.o \
++ $(link-extra-libs-tests) \
++ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
++ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
++ $(+link-tests)
++endif
++
+ ifneq "$(strip $(binaries-pie-tests))" ""
+ $(addprefix $(objpfx),$(binaries-pie-tests)): %: %.o \
+ $(link-extra-libs-tests) \
+@@ -253,6 +264,12 @@ $(addprefix $(objpfx),$(binaries-static-
+ $(+link-static-tests)
+ endif
+
++# All mcheck tests will be run with MALLOC_CHECK_=3
++define mcheck-ENVS
++$(1)-mcheck-ENV = MALLOC_CHECK_=3
++endef
++$(foreach t,$(tests-mcheck),$(eval $(call mcheck-ENVS,$(t))))
++
+ ifneq "$(strip $(tests) $(tests-internal) $(xtests) $(test-srcs))" ""
+ # These are the implicit rules for making test outputs
+ # from the test programs and whatever input files are present.
+diff -pruN glibc-2.32.orig/stdio-common/errlist.c glibc-2.32/stdio-common/errlist.c
+--- glibc-2.32.orig/stdio-common/errlist.c 2021-09-18 21:02:32.698184545 +1000
++++ glibc-2.32/stdio-common/errlist.c 2021-09-18 21:03:05.312302287 +1000
@@ -20,9 +20,13 @@
#include <libintl.h>
#include <array_length.h>
@@ -2120,10 +2081,22 @@ index d15f13a22a..2ecf121674 100644
#include <errlist.h>
#undef _S
};
-diff --git a/stdio-common/test-strerr.c b/stdio-common/test-strerr.c
-index fded208118..d77b81d507 100644
---- a/stdio-common/test-strerr.c
-+++ b/stdio-common/test-strerr.c
+diff -pruN glibc-2.32.orig/stdio-common/Makefile glibc-2.32/stdio-common/Makefile
+--- glibc-2.32.orig/stdio-common/Makefile 2021-09-18 21:02:32.698184545 +1000
++++ glibc-2.32/stdio-common/Makefile 2021-09-18 21:03:05.312302287 +1000
+@@ -69,7 +69,8 @@ tests := tstscanf test_rdwr test-popen t
+ tst-printf-bz25691 \
+ tst-vfprintf-width-prec-alloc \
+ tst-printf-fp-free \
+- tst-printf-fp-leak
++ tst-printf-fp-leak \
++ test-strerr
+
+
+ test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble
+diff -pruN glibc-2.32.orig/stdio-common/test-strerr.c glibc-2.32/stdio-common/test-strerr.c
+--- glibc-2.32.orig/stdio-common/test-strerr.c 2021-09-18 21:02:32.698184545 +1000
++++ glibc-2.32/stdio-common/test-strerr.c 2021-09-18 21:03:05.312302287 +1000
@@ -18,46 +18,672 @@
#include <string.h>
@@ -2829,11 +2802,10 @@ index fded208118..d77b81d507 100644
return 0;
}
-diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c
-index 95b46dcbeb..3a323547f9 100644
---- a/stdio-common/vfscanf-internal.c
-+++ b/stdio-common/vfscanf-internal.c
-@@ -277,7 +277,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+diff -pruN glibc-2.32.orig/stdio-common/vfscanf-internal.c glibc-2.32/stdio-common/vfscanf-internal.c
+--- glibc-2.32.orig/stdio-common/vfscanf-internal.c 2021-09-18 21:02:32.699184579 +1000
++++ glibc-2.32/stdio-common/vfscanf-internal.c 2021-09-18 21:03:05.312302287 +1000
+@@ -277,7 +277,7 @@ __vfscanf_internal (FILE *s, const char
#endif
{
va_list arg;
@@ -2842,7 +2814,7 @@ index 95b46dcbeb..3a323547f9 100644
UCHAR_T fc; /* Current character of the format. */
WINT_T done = 0; /* Assignments done. */
size_t read_in = 0; /* Chars read in. */
-@@ -415,10 +415,11 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -415,10 +415,11 @@ __vfscanf_internal (FILE *s, const char
#endif
#ifndef COMPILE_WSCANF
@@ -2856,7 +2828,7 @@ index 95b46dcbeb..3a323547f9 100644
if (len > 0)
{
do
-@@ -426,7 +427,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -426,7 +427,7 @@ __vfscanf_internal (FILE *s, const char
c = inchar ();
if (__glibc_unlikely (c == EOF))
input_error ();
@@ -2865,7 +2837,7 @@ index 95b46dcbeb..3a323547f9 100644
{
ungetc_not_eof (c, s);
conv_error ();
-@@ -484,9 +485,9 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -484,9 +485,9 @@ __vfscanf_internal (FILE *s, const char
char_buffer_rewind (&charbuf);
/* Check for a positional parameter specification. */
@@ -2877,7 +2849,7 @@ index 95b46dcbeb..3a323547f9 100644
if (*f == L_('$'))
++f;
else
-@@ -521,8 +522,8 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -521,8 +522,8 @@ __vfscanf_internal (FILE *s, const char
/* Find the maximum field width. */
width = 0;
@@ -2888,7 +2860,7 @@ index 95b46dcbeb..3a323547f9 100644
got_width:
if (width == 0)
width = -1;
-@@ -2522,12 +2523,11 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
+@@ -2522,12 +2523,11 @@ __vfscanf_internal (FILE *s, const char
}
while ((fc = *f++) != '\0' && fc != ']')
@@ -2903,10 +2875,9 @@ index 95b46dcbeb..3a323547f9 100644
((char *)charbuf.scratch.data)[fc] = 1;
}
else
-diff --git a/stdlib/tst-secure-getenv.c b/stdlib/tst-secure-getenv.c
-index 3cfe9a05c3..d4b1139c5e 100644
---- a/stdlib/tst-secure-getenv.c
-+++ b/stdlib/tst-secure-getenv.c
+diff -pruN glibc-2.32.orig/stdlib/tst-secure-getenv.c glibc-2.32/stdlib/tst-secure-getenv.c
+--- glibc-2.32.orig/stdlib/tst-secure-getenv.c 2021-09-18 21:02:32.700184614 +1000
++++ glibc-2.32/stdlib/tst-secure-getenv.c 2021-09-18 21:03:05.312302287 +1000
@@ -30,167 +30,12 @@
#include <sys/wait.h>
#include <unistd.h>
@@ -3133,10 +3104,9 @@ index 3cfe9a05c3..d4b1139c5e 100644
}
}
-diff --git a/string/bits/string_fortified.h b/string/bits/string_fortified.h
-index 309d0f39b2..c8d3051af8 100644
---- a/string/bits/string_fortified.h
-+++ b/string/bits/string_fortified.h
+diff -pruN glibc-2.32.orig/string/bits/string_fortified.h glibc-2.32/string/bits/string_fortified.h
+--- glibc-2.32.orig/string/bits/string_fortified.h 2021-09-18 21:02:32.700184614 +1000
++++ glibc-2.32/string/bits/string_fortified.h 2021-09-18 21:03:05.312302287 +1000
@@ -22,11 +22,6 @@
# error "Never use <bits/string_fortified.h> directly; include <string.h> instead."
#endif
@@ -3149,7 +3119,7 @@ index 309d0f39b2..c8d3051af8 100644
__fortify_function void *
__NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __len))
-@@ -58,16 +53,6 @@ __NTH (mempcpy (void *__restrict __dest, const void *__restrict __src,
+@@ -58,16 +53,6 @@ __NTH (mempcpy (void *__restrict __dest,
__fortify_function void *
__NTH (memset (void *__dest, int __ch, size_t __len))
{
@@ -3166,24 +3136,10 @@ index 309d0f39b2..c8d3051af8 100644
return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
}
-diff --git a/support/Makefile b/support/Makefile
-index 93faafddf9..4154863511 100644
---- a/support/Makefile
-+++ b/support/Makefile
-@@ -35,6 +35,8 @@ libsupport-routines = \
- ignore_stderr \
- next_to_fault \
- oom_error \
-+ resolv_response_context_duplicate \
-+ resolv_response_context_free \
- resolv_test \
- set_fortify_handler \
- support-xfstat \
-diff --git a/support/capture_subprocess.h b/support/capture_subprocess.h
-index 9808750f80..421f657678 100644
---- a/support/capture_subprocess.h
-+++ b/support/capture_subprocess.h
-@@ -41,6 +41,12 @@ struct support_capture_subprocess support_capture_subprocess
+diff -pruN glibc-2.32.orig/support/capture_subprocess.h glibc-2.32/support/capture_subprocess.h
+--- glibc-2.32.orig/support/capture_subprocess.h 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/capture_subprocess.h 2021-09-18 21:03:05.312302287 +1000
+@@ -41,6 +41,12 @@ struct support_capture_subprocess suppor
struct support_capture_subprocess support_capture_subprogram
(const char *file, char *const argv[]);
@@ -3196,11 +3152,21 @@ index 9808750f80..421f657678 100644
/* Deallocate the subprocess data captured by
support_capture_subprocess. */
void support_capture_subprocess_free (struct support_capture_subprocess *);
-diff --git a/support/resolv_response_context_duplicate.c b/support/resolv_response_context_duplicate.c
-new file mode 100644
-index 0000000000..f9c5c3462a
---- /dev/null
-+++ b/support/resolv_response_context_duplicate.c
+diff -pruN glibc-2.32.orig/support/Makefile glibc-2.32/support/Makefile
+--- glibc-2.32.orig/support/Makefile 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/Makefile 2021-09-18 21:03:05.312302287 +1000
+@@ -35,6 +35,8 @@ libsupport-routines = \
+ ignore_stderr \
+ next_to_fault \
+ oom_error \
++ resolv_response_context_duplicate \
++ resolv_response_context_free \
+ resolv_test \
+ set_fortify_handler \
+ support-xfstat \
+diff -pruN glibc-2.32.orig/support/resolv_response_context_duplicate.c glibc-2.32/support/resolv_response_context_duplicate.c
+--- glibc-2.32.orig/support/resolv_response_context_duplicate.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/support/resolv_response_context_duplicate.c 2021-09-18 21:03:05.312302287 +1000
@@ -0,0 +1,37 @@
+/* Duplicate a response context used in DNS resolver tests.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -3239,11 +3205,9 @@ index 0000000000..f9c5c3462a
+ memcpy (result->query_buffer, ctx->query_buffer, result->query_length);
+ return result;
+}
-diff --git a/support/resolv_response_context_free.c b/support/resolv_response_context_free.c
-new file mode 100644
-index 0000000000..b88c05ffd4
---- /dev/null
-+++ b/support/resolv_response_context_free.c
+diff -pruN glibc-2.32.orig/support/resolv_response_context_free.c glibc-2.32/support/resolv_response_context_free.c
+--- glibc-2.32.orig/support/resolv_response_context_free.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/support/resolv_response_context_free.c 2021-09-18 21:03:05.312302287 +1000
@@ -0,0 +1,28 @@
+/* Free a response context used in DNS resolver tests.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -3273,11 +3237,10 @@ index 0000000000..b88c05ffd4
+ free (ctx->client_address);
+ free (ctx);
+}
-diff --git a/support/resolv_test.c b/support/resolv_test.c
-index 53b7fc41ab..9878a040a3 100644
---- a/support/resolv_test.c
-+++ b/support/resolv_test.c
-@@ -181,7 +181,9 @@ resolv_response_init (struct resolv_response_builder *b,
+diff -pruN glibc-2.32.orig/support/resolv_test.c glibc-2.32/support/resolv_test.c
+--- glibc-2.32.orig/support/resolv_test.c 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/resolv_test.c 2021-09-18 21:03:05.312302287 +1000
+@@ -181,7 +181,9 @@ resolv_response_init (struct resolv_resp
b->buffer[2] |= b->query_buffer[2] & 0x01; /* Copy the RD bit. */
if (flags.tc)
b->buffer[2] |= 0x02;
@@ -3288,7 +3251,7 @@ index 53b7fc41ab..9878a040a3 100644
if (flags.ad)
b->buffer[3] |= 0x20;
-@@ -434,9 +436,9 @@ resolv_response_buffer (const struct resolv_response_builder *b)
+@@ -434,9 +436,9 @@ resolv_response_buffer (const struct res
return result;
}
@@ -3312,7 +3275,7 @@ index 53b7fc41ab..9878a040a3 100644
{
tdestroy (b->compression_offsets, free);
free (b);
-@@ -661,13 +663,17 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
+@@ -661,13 +663,17 @@ server_thread_udp_process_one (struct re
struct resolv_response_context ctx =
{
@@ -3331,7 +3294,7 @@ index 53b7fc41ab..9878a040a3 100644
obj->config.response_callback
(&ctx, b, qinfo.qname, qinfo.qclass, qinfo.qtype);
-@@ -684,7 +690,7 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
+@@ -684,7 +690,7 @@ server_thread_udp_process_one (struct re
if (b->offset >= 12)
printf ("info: UDP server %d: sending response:"
" %zu bytes, RCODE %d (for %s/%u/%u)\n",
@@ -3340,7 +3303,7 @@ index 53b7fc41ab..9878a040a3 100644
qinfo.qname, qinfo.qclass, qinfo.qtype);
else
printf ("info: UDP server %d: sending response: %zu bytes"
-@@ -694,23 +700,31 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
+@@ -694,23 +700,31 @@ server_thread_udp_process_one (struct re
if (b->truncate_bytes > 0)
printf ("info: truncated by %u bytes\n", b->truncate_bytes);
}
@@ -3412,10 +3375,9 @@ index 53b7fc41ab..9878a040a3 100644
free (query_buffer);
if (close_flag)
break;
-diff --git a/support/resolv_test.h b/support/resolv_test.h
-index 67819469a0..31a5c1c3e7 100644
---- a/support/resolv_test.h
-+++ b/support/resolv_test.h
+diff -pruN glibc-2.32.orig/support/resolv_test.h glibc-2.32/support/resolv_test.h
+--- glibc-2.32.orig/support/resolv_test.h 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/resolv_test.h 2021-09-18 21:03:05.312302287 +1000
@@ -35,25 +35,36 @@ struct resolv_edns_info
uint16_t payload_size;
};
@@ -3469,7 +3431,7 @@ index 67819469a0..31a5c1c3e7 100644
/* Initial section count values. Can be used to artificially
increase the counts, for malformed packet testing.*/
unsigned short qdcount;
-@@ -188,6 +203,22 @@ void resolv_response_close (struct resolv_response_builder *);
+@@ -188,6 +203,22 @@ void resolv_response_close (struct resol
/* The size of the response packet built so far. */
size_t resolv_response_length (const struct resolv_response_builder *);
@@ -3492,11 +3454,10 @@ index 67819469a0..31a5c1c3e7 100644
__END_DECLS
#endif /* SUPPORT_RESOLV_TEST_H */
-diff --git a/support/subprocess.h b/support/subprocess.h
-index 8b442fd5c0..34ffd02e8e 100644
---- a/support/subprocess.h
-+++ b/support/subprocess.h
-@@ -38,6 +38,11 @@ struct support_subprocess support_subprocess
+diff -pruN glibc-2.32.orig/support/subprocess.h glibc-2.32/support/subprocess.h
+--- glibc-2.32.orig/support/subprocess.h 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/subprocess.h 2021-09-18 21:03:05.312302287 +1000
+@@ -38,6 +38,11 @@ struct support_subprocess support_subpro
struct support_subprocess support_subprogram
(const char *file, char *const argv[]);
@@ -3508,10 +3469,9 @@ index 8b442fd5c0..34ffd02e8e 100644
/* Wait for the subprocess indicated by PROC::PID. Return the status
indicate by waitpid call. */
int support_process_wait (struct support_subprocess *proc);
-diff --git a/support/support_capture_subprocess.c b/support/support_capture_subprocess.c
-index eeed676e3d..28a37df67f 100644
---- a/support/support_capture_subprocess.c
-+++ b/support/support_capture_subprocess.c
+diff -pruN glibc-2.32.orig/support/support_capture_subprocess.c glibc-2.32/support/support_capture_subprocess.c
+--- glibc-2.32.orig/support/support_capture_subprocess.c 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/support_capture_subprocess.c 2021-09-18 21:03:05.313302322 +1000
@@ -20,11 +20,14 @@
#include <support/capture_subprocess.h>
@@ -3527,7 +3487,7 @@ index eeed676e3d..28a37df67f 100644
static void
transfer (const char *what, struct pollfd *pfd, struct xmemstream *stream)
-@@ -36,7 +39,7 @@ transfer (const char *what, struct pollfd *pfd, struct xmemstream *stream)
+@@ -36,7 +39,7 @@ transfer (const char *what, struct pollf
if (ret < 0)
{
support_record_failure ();
@@ -3536,7 +3496,7 @@ index eeed676e3d..28a37df67f 100644
pfd->events = 0;
pfd->revents = 0;
}
-@@ -102,6 +105,129 @@ support_capture_subprogram (const char *file, char *const argv[])
+@@ -102,6 +105,129 @@ support_capture_subprogram (const char *
return result;
}
@@ -3666,10 +3626,9 @@ index eeed676e3d..28a37df67f 100644
void
support_capture_subprocess_free (struct support_capture_subprocess *p)
{
-diff --git a/support/support_subprocess.c b/support/support_subprocess.c
-index 36e3a77af2..4a25828111 100644
---- a/support/support_subprocess.c
-+++ b/support/support_subprocess.c
+diff -pruN glibc-2.32.orig/support/support_subprocess.c glibc-2.32/support/support_subprocess.c
+--- glibc-2.32.orig/support/support_subprocess.c 2021-09-18 21:02:32.701184648 +1000
++++ glibc-2.32/support/support_subprocess.c 2021-09-18 21:03:05.313302322 +1000
@@ -27,7 +27,7 @@
#include <support/subprocess.h>
@@ -3688,7 +3647,7 @@ index 36e3a77af2..4a25828111 100644
result.pid = xfork ();
if (result.pid == 0)
-@@ -71,7 +71,7 @@ support_subprocess (void (*callback) (void *), void *closure)
+@@ -71,7 +71,7 @@ support_subprocess (void (*callback) (vo
struct support_subprocess
support_subprogram (const char *file, char *const argv[])
{
@@ -3697,7 +3656,7 @@ index 36e3a77af2..4a25828111 100644
posix_spawn_file_actions_t fa;
/* posix_spawn_file_actions_init does not fail. */
-@@ -84,7 +84,7 @@ support_subprogram (const char *file, char *const argv[])
+@@ -84,7 +84,7 @@ support_subprogram (const char *file, ch
xposix_spawn_file_actions_addclose (&fa, result.stdout_pipe[1]);
xposix_spawn_file_actions_addclose (&fa, result.stderr_pipe[1]);
@@ -3706,11 +3665,10 @@ index 36e3a77af2..4a25828111 100644
xclose (result.stdout_pipe[1]);
xclose (result.stderr_pipe[1]);
-@@ -92,6 +92,19 @@ support_subprogram (const char *file, char *const argv[])
- return result;
+@@ -93,6 +93,19 @@ support_subprogram (const char *file, ch
}
-+int
+ int
+support_subprogram_wait (const char *file, char *const argv[])
+{
+ posix_spawn_file_actions_t fa;
@@ -3723,13 +3681,13 @@ index 36e3a77af2..4a25828111 100644
+ return support_process_wait (&res);
+}
+
- int
++int
support_process_wait (struct support_subprocess *proc)
{
-diff --git a/sysdeps/aarch64/dl-bti.c b/sysdeps/aarch64/dl-bti.c
-index 196e462520..cf7624aaa2 100644
---- a/sysdeps/aarch64/dl-bti.c
-+++ b/sysdeps/aarch64/dl-bti.c
+ xclose (proc->stdout_pipe[0]);
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/dl-bti.c glibc-2.32/sysdeps/aarch64/dl-bti.c
+--- glibc-2.32.orig/sysdeps/aarch64/dl-bti.c 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/dl-bti.c 2021-09-18 21:03:05.313302322 +1000
@@ -19,43 +19,76 @@
#include <errno.h>
#include <libintl.h>
@@ -3826,11 +3784,10 @@ index 196e462520..cf7624aaa2 100644
+ bti_failed (dep, program);
+ }
}
-diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
-index 70b9ed3925..fde7cfd9e2 100644
---- a/sysdeps/aarch64/dl-machine.h
-+++ b/sysdeps/aarch64/dl-machine.h
-@@ -395,13 +395,6 @@ elf_machine_lazy_rel (struct link_map *map,
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/dl-machine.h glibc-2.32/sysdeps/aarch64/dl-machine.h
+--- glibc-2.32.orig/sysdeps/aarch64/dl-machine.h 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/dl-machine.h 2021-09-18 21:03:05.313302322 +1000
+@@ -395,13 +395,6 @@ elf_machine_lazy_rel (struct link_map *m
/* Check for unexpected PLT reloc type. */
if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1))
{
@@ -3844,7 +3801,7 @@ index 70b9ed3925..fde7cfd9e2 100644
if (__glibc_unlikely (map->l_info[DT_AARCH64 (VARIANT_PCS)] != NULL))
{
/* Check the symbol table for variant PCS symbols. */
-@@ -425,7 +418,10 @@ elf_machine_lazy_rel (struct link_map *map,
+@@ -425,7 +418,10 @@ elf_machine_lazy_rel (struct link_map *m
}
}
@@ -3856,10 +3813,9 @@ index 70b9ed3925..fde7cfd9e2 100644
}
else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1))
{
-diff --git a/sysdeps/aarch64/dl-prop.h b/sysdeps/aarch64/dl-prop.h
-index b0785bda83..e926e54984 100644
---- a/sysdeps/aarch64/dl-prop.h
-+++ b/sysdeps/aarch64/dl-prop.h
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/dl-prop.h glibc-2.32/sysdeps/aarch64/dl-prop.h
+--- glibc-2.32.orig/sysdeps/aarch64/dl-prop.h 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/dl-prop.h 2021-09-18 21:03:05.313302322 +1000
@@ -19,6 +19,8 @@
#ifndef _DL_PROP_H
#define _DL_PROP_H
@@ -3891,7 +3847,7 @@ index b0785bda83..e926e54984 100644
if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND)
{
/* Stop if the property note is ill-formed. */
-@@ -51,7 +57,7 @@ _dl_process_gnu_property (struct link_map *l, uint32_t type, uint32_t datasz,
+@@ -51,7 +57,7 @@ _dl_process_gnu_property (struct link_ma
unsigned int feature_1 = *(unsigned int *) data;
if (feature_1 & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
@@ -3900,10 +3856,9 @@ index b0785bda83..e926e54984 100644
/* Stop if we processed the property note. */
return 0;
-diff --git a/sysdeps/aarch64/linkmap.h b/sysdeps/aarch64/linkmap.h
-index 847a03ace2..b3f7663b07 100644
---- a/sysdeps/aarch64/linkmap.h
-+++ b/sysdeps/aarch64/linkmap.h
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/linkmap.h glibc-2.32/sysdeps/aarch64/linkmap.h
+--- glibc-2.32.orig/sysdeps/aarch64/linkmap.h 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/linkmap.h 2021-09-18 21:03:05.313302322 +1000
@@ -22,5 +22,5 @@ struct link_map_machine
{
ElfW(Addr) plt; /* Address of .plt */
@@ -3911,24 +3866,9 @@ index 847a03ace2..b3f7663b07 100644
- bool bti; /* Branch Target Identification is enabled. */
+ bool bti_fail; /* Failed to enable Branch Target Identification. */
};
-diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c
-index 7cf5f033e8..799d60c98c 100644
---- a/sysdeps/aarch64/multiarch/memcpy.c
-+++ b/sysdeps/aarch64/multiarch/memcpy.c
-@@ -41,7 +41,8 @@ libc_ifunc (__libc_memcpy,
- ? __memcpy_falkor
- : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
- ? __memcpy_thunderx2
-- : (IS_NEOVERSE_N1 (midr)
-+ : (IS_NEOVERSE_N1 (midr) || IS_NEOVERSE_N2 (midr)
-+ || IS_NEOVERSE_V1 (midr)
- ? __memcpy_simd
- : __memcpy_generic)))));
-
-diff --git a/sysdeps/aarch64/multiarch/memcpy_advsimd.S b/sysdeps/aarch64/multiarch/memcpy_advsimd.S
-index d4ba747777..48bb6d7ca4 100644
---- a/sysdeps/aarch64/multiarch/memcpy_advsimd.S
-+++ b/sysdeps/aarch64/multiarch/memcpy_advsimd.S
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy_advsimd.S glibc-2.32/sysdeps/aarch64/multiarch/memcpy_advsimd.S
+--- glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy_advsimd.S 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/multiarch/memcpy_advsimd.S 2021-09-18 21:03:05.313302322 +1000
@@ -223,12 +223,13 @@ L(copy_long_backwards):
b.ls L(copy64_from_start)
@@ -3946,10 +3886,22 @@ index d4ba747777..48bb6d7ca4 100644
subs count, count, 64
b.hi L(loop64_backwards)
-diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c
-index ad10aa8ac6..46a4cb3a54 100644
---- a/sysdeps/aarch64/multiarch/memmove.c
-+++ b/sysdeps/aarch64/multiarch/memmove.c
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy.c glibc-2.32/sysdeps/aarch64/multiarch/memcpy.c
+--- glibc-2.32.orig/sysdeps/aarch64/multiarch/memcpy.c 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/multiarch/memcpy.c 2021-09-18 21:03:05.313302322 +1000
+@@ -41,7 +41,8 @@ libc_ifunc (__libc_memcpy,
+ ? __memcpy_falkor
+ : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
+ ? __memcpy_thunderx2
+- : (IS_NEOVERSE_N1 (midr)
++ : (IS_NEOVERSE_N1 (midr) || IS_NEOVERSE_N2 (midr)
++ || IS_NEOVERSE_V1 (midr)
+ ? __memcpy_simd
+ : __memcpy_generic)))));
+
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/multiarch/memmove.c glibc-2.32/sysdeps/aarch64/multiarch/memmove.c
+--- glibc-2.32.orig/sysdeps/aarch64/multiarch/memmove.c 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/multiarch/memmove.c 2021-09-18 21:03:05.313302322 +1000
@@ -41,7 +41,8 @@ libc_ifunc (__libc_memmove,
? __memmove_falkor
: (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
@@ -3960,10 +3912,9 @@ index ad10aa8ac6..46a4cb3a54 100644
? __memmove_simd
: __memmove_generic)))));
-diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
-index 75393e1c18..1998ea95d4 100644
---- a/sysdeps/aarch64/start.S
-+++ b/sysdeps/aarch64/start.S
+diff -pruN glibc-2.32.orig/sysdeps/aarch64/start.S glibc-2.32/sysdeps/aarch64/start.S
+--- glibc-2.32.orig/sysdeps/aarch64/start.S 2021-09-18 21:02:32.702184682 +1000
++++ glibc-2.32/sysdeps/aarch64/start.S 2021-09-18 21:03:05.313302322 +1000
@@ -43,11 +43,9 @@
*/
@@ -3989,10 +3940,9 @@ index 75393e1c18..1998ea95d4 100644
/* Define a symbol for the first piece of initialized data. */
.data
-diff --git a/sysdeps/generic/dl-prop.h b/sysdeps/generic/dl-prop.h
-index f1cf576fe3..df27ff8e6a 100644
---- a/sysdeps/generic/dl-prop.h
-+++ b/sysdeps/generic/dl-prop.h
+diff -pruN glibc-2.32.orig/sysdeps/generic/dl-prop.h glibc-2.32/sysdeps/generic/dl-prop.h
+--- glibc-2.32.orig/sysdeps/generic/dl-prop.h 2021-09-18 21:02:32.705184785 +1000
++++ glibc-2.32/sysdeps/generic/dl-prop.h 2021-09-18 21:03:05.313302322 +1000
@@ -37,15 +37,15 @@ _dl_open_check (struct link_map *m)
}
@@ -4012,11 +3962,10 @@ index f1cf576fe3..df27ff8e6a 100644
{
return 0;
}
-diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
-index ba114ab4b1..62ac40d81b 100644
---- a/sysdeps/generic/ldsodefs.h
-+++ b/sysdeps/generic/ldsodefs.h
-@@ -919,8 +919,9 @@ extern void _dl_rtld_di_serinfo (struct link_map *loader,
+diff -pruN glibc-2.32.orig/sysdeps/generic/ldsodefs.h glibc-2.32/sysdeps/generic/ldsodefs.h
+--- glibc-2.32.orig/sysdeps/generic/ldsodefs.h 2021-09-18 21:02:32.705184785 +1000
++++ glibc-2.32/sysdeps/generic/ldsodefs.h 2021-09-18 21:03:05.313302322 +1000
+@@ -919,8 +919,9 @@ extern void _dl_rtld_di_serinfo (struct
Dl_serinfo *si, bool counting);
/* Process PT_GNU_PROPERTY program header PH in module L after
@@ -4028,11 +3977,10 @@ index ba114ab4b1..62ac40d81b 100644
/* Search loaded objects' symbol tables for a definition of the symbol
-diff --git a/sysdeps/generic/unwind.h b/sysdeps/generic/unwind.h
-index b667a5b652..c229603af3 100644
---- a/sysdeps/generic/unwind.h
-+++ b/sysdeps/generic/unwind.h
-@@ -75,15 +75,21 @@ typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+diff -pruN glibc-2.32.orig/sysdeps/generic/unwind.h glibc-2.32/sysdeps/generic/unwind.h
+--- glibc-2.32.orig/sysdeps/generic/unwind.h 2021-09-18 21:02:32.706184819 +1000
++++ glibc-2.32/sysdeps/generic/unwind.h 2021-09-18 21:03:05.313302322 +1000
+@@ -75,15 +75,21 @@ typedef void (*_Unwind_Exception_Cleanup
struct _Unwind_Exception
{
@@ -4040,11 +3988,6 @@ index b667a5b652..c229603af3 100644
- _Unwind_Exception_Cleanup_Fn exception_cleanup;
- _Unwind_Word private_1;
- _Unwind_Word private_2;
--
-- /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
-- Taking that literally does not make much sense generically. Instead we
-- provide the maximum alignment required by any type for the machine. */
--} __attribute__((__aligned__));
+ union
+ {
+ struct
@@ -4054,7 +3997,11 @@ index b667a5b652..c229603af3 100644
+ _Unwind_Word private_1;
+ _Unwind_Word private_2;
+ };
-+
+
+- /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+- Taking that literally does not make much sense generically. Instead we
+- provide the maximum alignment required by any type for the machine. */
+-} __attribute__((__aligned__));
+ /* The IA-64 ABI says that this structure must be double-word aligned. */
+ _Unwind_Word unwind_exception_align[2]
+ __attribute__ ((__aligned__ (2 * sizeof (_Unwind_Word))));
@@ -4063,10 +4010,9 @@ index b667a5b652..c229603af3 100644
/* The ACTIONS argument to the personality routine is a bitwise OR of one
-diff --git a/sysdeps/gnu/errlist.h b/sysdeps/gnu/errlist.h
-index 5d11ed723d..6329e5f393 100644
---- a/sysdeps/gnu/errlist.h
-+++ b/sysdeps/gnu/errlist.h
+diff -pruN glibc-2.32.orig/sysdeps/gnu/errlist.h glibc-2.32/sysdeps/gnu/errlist.h
+--- glibc-2.32.orig/sysdeps/gnu/errlist.h 2021-09-18 21:02:32.706184819 +1000
++++ glibc-2.32/sysdeps/gnu/errlist.h 2021-09-18 21:03:05.313302322 +1000
@@ -1,24 +1,21 @@
-#ifndef ERR_MAP
-#define ERR_MAP(value) value
@@ -4111,7 +4057,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENXIO
/*
-@@ -43,7 +40,7 @@ TRANS represented by a file you specified, and it couldn't find the device.
+@@ -43,7 +40,7 @@ TRANS represented by a file you specifie
TRANS This can mean that the device file was installed incorrectly, or that
TRANS the physical device is missing or not correctly attached to the
TRANS computer. */
@@ -4120,7 +4066,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef E2BIG
/*
-@@ -51,27 +48,27 @@ TRANS Used when the arguments passed to a new program
+@@ -51,27 +48,27 @@ TRANS Used when the arguments passed to
TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
TRANS File}) occupy too much memory space. This condition never arises on
TRANS @gnuhurdsystems{}. */
@@ -4152,7 +4098,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EDEADLK
/*
-@@ -79,74 +76,74 @@ TRANS Allocating a system resource would have resulted in a
+@@ -79,74 +76,74 @@ TRANS Allocating a system resource would
TRANS deadlock situation. The system does not guarantee that it will notice
TRANS all such situations. This error means you got lucky and the system
TRANS noticed; it might just hang. @xref{File Locks}, for an example. */
@@ -4239,7 +4185,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EMFILE
/*
-@@ -157,20 +154,20 @@ TRANS In BSD and GNU, the number of open files is controlled by a resource
+@@ -157,20 +154,20 @@ TRANS In BSD and GNU, the number of open
TRANS limit that can usually be increased. If you get this error, you might
TRANS want to increase the @code{RLIMIT_NOFILE} limit or make it unlimited;
TRANS @pxref{Limits on Resources}. */
@@ -4263,7 +4209,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ETXTBSY
/*
-@@ -179,35 +176,35 @@ TRANS write to a file that is currently being executed. Often using a
+@@ -179,35 +176,35 @@ TRANS write to a file that is currently
TRANS debugger to run a program is considered having it open for writing and
TRANS will cause this error. (The name stands for ``text file busy''.) This
TRANS is not an error on @gnuhurdsystems{}; the text is copied as necessary. */
@@ -4305,7 +4251,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EPIPE
/*
-@@ -216,19 +213,19 @@ TRANS Every library function that returns this error code also generates a
+@@ -216,19 +213,19 @@ TRANS Every library function that return
TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
TRANS or blocked. Thus, your program will never actually see @code{EPIPE}
TRANS unless it has handled or blocked @code{SIGPIPE}. */
@@ -4328,7 +4274,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EAGAIN
/*
-@@ -261,7 +258,7 @@ TRANS Such shortages are usually fairly serious and affect the whole system,
+@@ -261,7 +258,7 @@ TRANS Such shortages are usually fairly
TRANS so usually an interactive program should report the error to the user
TRANS and return to its command loop.
TRANS @end itemize */
@@ -4337,7 +4283,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EINPROGRESS
/*
-@@ -273,47 +270,47 @@ TRANS the operation has begun and will take some time. Attempts to manipulate
+@@ -273,47 +270,47 @@ TRANS the operation has begun and will t
TRANS the object before the call completes return @code{EALREADY}. You can
TRANS use the @code{select} function to find out when the pending operation
TRANS has completed; @pxref{Waiting for I/O}. */
@@ -4393,7 +4339,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EOPNOTSUPP
/*
-@@ -323,71 +320,71 @@ TRANS implemented for all communications protocols. On @gnuhurdsystems{}, this
+@@ -323,71 +320,71 @@ TRANS implemented for all communications
TRANS error can happen for many calls when the object does not support the
TRANS particular operation; it is a generic indication that the server knows
TRANS nothing to do for that call. */
@@ -4477,7 +4423,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENOTCONN
/*
-@@ -395,74 +392,74 @@ TRANS The socket is not connected to anything. You get this error when you
+@@ -395,74 +392,74 @@ TRANS The socket is not connected to any
TRANS try to transmit data over a socket, without first specifying a
TRANS destination for the data. For a connectionless socket (for datagram
TRANS protocols, such as UDP), you get @code{EDESTADDRREQ} instead. */
@@ -4565,7 +4511,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ESTALE
/*
-@@ -471,7 +468,7 @@ TRANS file system which is due to file system rearrangements on the server host
+@@ -471,7 +468,7 @@ TRANS file system which is due to file s
TRANS for NFS file systems or corruption in other file systems.
TRANS Repairing this condition usually requires unmounting, possibly repairing
TRANS and remounting the file system. */
@@ -4574,7 +4520,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EREMOTE
/*
-@@ -479,7 +476,7 @@ TRANS An attempt was made to NFS-mount a remote file system with a file name tha
+@@ -479,7 +476,7 @@ TRANS An attempt was made to NFS-mount a
TRANS already specifies an NFS-mounted file.
TRANS (This is an error on some operating systems, but we expect it to work
TRANS properly on @gnuhurdsystems{}, making this error code impossible.) */
@@ -4583,7 +4529,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENOLCK
/*
-@@ -487,7 +484,7 @@ TRANS This is used by the file locking facilities; see
+@@ -487,7 +484,7 @@ TRANS This is used by the file locking f
TRANS @ref{File Locks}. This error is never generated by @gnuhurdsystems{}, but
TRANS it can result from an operation to an NFS server running another
TRANS operating system. */
@@ -4592,7 +4538,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ENOSYS
/*
-@@ -496,46 +493,46 @@ TRANS not implemented at all, either in the C library itself or in the
+@@ -496,46 +493,46 @@ TRANS not implemented at all, either in
TRANS operating system. When you get this error, you can be sure that this
TRANS particular function will always fail with @code{ENOSYS} unless you
TRANS install a new version of the C library or the operating system. */
@@ -4652,7 +4598,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef ECANCELED
/*
-@@ -543,148 +540,148 @@ TRANS An asynchronous operation was canceled before it
+@@ -543,148 +540,148 @@ TRANS An asynchronous operation was canc
TRANS completed. @xref{Asynchronous I/O}. When you call @code{aio_cancel},
TRANS the normal result is for the operations affected to complete with this
TRANS error; @pxref{Cancel AIO Operations}. */
@@ -4849,7 +4795,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EFTYPE
/*
-@@ -693,40 +690,40 @@ TRANS operation, or a data file had the wrong format.
+@@ -693,40 +690,40 @@ TRANS operation, or a data file had the
TRANS
TRANS On some systems @code{chmod} returns this error if you try to set the
TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}. */
@@ -4911,7 +4857,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EBACKGROUND
/*
-@@ -755,7 +752,7 @@ TRANS foreground process group of the terminal. Users do not usually see this
+@@ -755,7 +752,7 @@ TRANS foreground process group of the te
TRANS error because functions such as @code{read} and @code{write} translate
TRANS it into a @code{SIGTTIN} or @code{SIGTTOU} signal. @xref{Job Control},
TRANS for information on process groups and these signals. */
@@ -4920,7 +4866,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#ifdef EIEIO
/*
-@@ -773,7 +770,7 @@ TRANS @c "bought the farm" means "died". -jtobey
+@@ -773,7 +770,7 @@ TRANS @c "bought the farm" means "died".
TRANS @c
TRANS @c Translators, please do not translate this litteraly, translate it into
TRANS @c an idiomatic funny way of saying that the computer died. */
@@ -4929,7 +4875,7 @@ index 5d11ed723d..6329e5f393 100644
#endif
#if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
/*
-@@ -782,18 +779,18 @@ TRANS The values are always the same, on every operating system.
+@@ -782,18 +779,18 @@ TRANS The values are always the same, on
TRANS
TRANS C libraries in many older Unix systems have @code{EWOULDBLOCK} as a
TRANS separate error code. */
@@ -4952,11 +4898,10 @@ index 5d11ed723d..6329e5f393 100644
-_S(ERR_MAP(EPROGUNAVAIL), N_("RPC program not available"))
+_S(EPROGUNAVAIL, N_("RPC program not available"))
#endif
-diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
-index 0f08079e48..672d8f27ce 100644
---- a/sysdeps/i386/dl-machine.h
-+++ b/sysdeps/i386/dl-machine.h
-@@ -338,16 +338,22 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+diff -pruN glibc-2.32.orig/sysdeps/i386/dl-machine.h glibc-2.32/sysdeps/i386/dl-machine.h
+--- glibc-2.32.orig/sysdeps/i386/dl-machine.h 2021-09-18 21:02:32.707184853 +1000
++++ glibc-2.32/sysdeps/i386/dl-machine.h 2021-09-18 21:03:05.313302322 +1000
+@@ -338,16 +338,22 @@ elf_machine_rel (struct link_map *map, c
{
# ifndef RTLD_BOOTSTRAP
if (sym_map != map
@@ -4984,10 +4929,9 @@ index 0f08079e48..672d8f27ce 100644
}
# endif
value = ((Elf32_Addr (*) (void)) value) ();
-diff --git a/sysdeps/powerpc/powerpc64/backtrace.c b/sysdeps/powerpc/powerpc64/backtrace.c
-index 8a53a1088f..362a2b713c 100644
---- a/sysdeps/powerpc/powerpc64/backtrace.c
-+++ b/sysdeps/powerpc/powerpc64/backtrace.c
+diff -pruN glibc-2.32.orig/sysdeps/powerpc/powerpc64/backtrace.c glibc-2.32/sysdeps/powerpc/powerpc64/backtrace.c
+--- glibc-2.32.orig/sysdeps/powerpc/powerpc64/backtrace.c 2021-09-18 21:02:32.723185402 +1000
++++ glibc-2.32/sysdeps/powerpc/powerpc64/backtrace.c 2021-09-18 21:03:05.313302322 +1000
@@ -54,11 +54,22 @@ struct signal_frame_64 {
/* We don't care about the rest, since the IP value is at 'uc' field. */
};
@@ -5012,10 +4956,9 @@ index 8a53a1088f..362a2b713c 100644
return true;
#endif
return false;
-diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
-index fa46e9e351..e7f576338d 100644
---- a/sysdeps/s390/configure
-+++ b/sysdeps/s390/configure
+diff -pruN glibc-2.32.orig/sysdeps/s390/configure glibc-2.32/sysdeps/s390/configure
+--- glibc-2.32.orig/sysdeps/s390/configure 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/configure 2021-09-18 21:03:05.313302322 +1000
@@ -123,7 +123,9 @@ void testinsn (char *buf)
__asm__ (".machine \"arch13\" \n\t"
".machinemode \"zarch_nohighgprs\" \n\t"
@@ -5038,10 +4981,9 @@ index fa46e9e351..e7f576338d 100644
}
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
-diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
-index 3ed5a8ef87..5c3479e8cf 100644
---- a/sysdeps/s390/configure.ac
-+++ b/sysdeps/s390/configure.ac
+diff -pruN glibc-2.32.orig/sysdeps/s390/configure.ac glibc-2.32/sysdeps/s390/configure.ac
+--- glibc-2.32.orig/sysdeps/s390/configure.ac 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/configure.ac 2021-09-18 21:03:05.313302322 +1000
@@ -88,7 +88,9 @@ void testinsn (char *buf)
__asm__ (".machine \"arch13\" \n\t"
".machinemode \"zarch_nohighgprs\" \n\t"
@@ -5064,11 +5006,10 @@ index 3ed5a8ef87..5c3479e8cf 100644
}
EOF
dnl test, if assembler supports S390 arch13 zarch instructions as default
-diff --git a/sysdeps/s390/memmove.c b/sysdeps/s390/memmove.c
-index 5fc85e129f..ee59b5de14 100644
---- a/sysdeps/s390/memmove.c
-+++ b/sysdeps/s390/memmove.c
-@@ -43,7 +43,7 @@ extern __typeof (__redirect_memmove) MEMMOVE_ARCH13 attribute_hidden;
+diff -pruN glibc-2.32.orig/sysdeps/s390/memmove.c glibc-2.32/sysdeps/s390/memmove.c
+--- glibc-2.32.orig/sysdeps/s390/memmove.c 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/memmove.c 2021-09-18 21:03:05.313302322 +1000
+@@ -43,7 +43,7 @@ extern __typeof (__redirect_memmove) MEM
s390_libc_ifunc_expr (__redirect_memmove, memmove,
({
s390_libc_ifunc_expr_stfle_init ();
@@ -5077,11 +5018,10 @@ index 5fc85e129f..ee59b5de14 100644
&& S390_IS_ARCH13_MIE3 (stfle_bits))
? MEMMOVE_ARCH13
: (HAVE_MEMMOVE_Z13 && (hwcap & HWCAP_S390_VX))
-diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c
-index e6195c6e26..17c0cc3952 100644
---- a/sysdeps/s390/multiarch/ifunc-impl-list.c
-+++ b/sysdeps/s390/multiarch/ifunc-impl-list.c
-@@ -171,7 +171,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
+diff -pruN glibc-2.32.orig/sysdeps/s390/multiarch/ifunc-impl-list.c glibc-2.32/sysdeps/s390/multiarch/ifunc-impl-list.c
+--- glibc-2.32.orig/sysdeps/s390/multiarch/ifunc-impl-list.c 2021-09-18 21:02:32.727185539 +1000
++++ glibc-2.32/sysdeps/s390/multiarch/ifunc-impl-list.c 2021-09-18 21:03:05.313302322 +1000
+@@ -171,7 +171,8 @@ __libc_ifunc_impl_list (const char *name
IFUNC_IMPL (i, name, memmove,
# if HAVE_MEMMOVE_ARCH13
IFUNC_IMPL_ADD (array, i, memmove,
@@ -5091,37 +5031,19 @@ index e6195c6e26..17c0cc3952 100644
MEMMOVE_ARCH13)
# endif
# if HAVE_MEMMOVE_Z13
-diff --git a/sysdeps/sh/be/sh4/fpu/Implies b/sysdeps/sh/be/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..71b28ee1a4
---- /dev/null
-+++ b/sysdeps/sh/be/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/sh/be/sh4/fpu/Implies glibc-2.32/sysdeps/sh/be/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/sh/be/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/sh/be/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+sh/sh4/fpu
-diff --git a/sysdeps/sh/le/sh4/fpu/Implies b/sysdeps/sh/le/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..71b28ee1a4
---- /dev/null
-+++ b/sysdeps/sh/le/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/sh/le/sh4/fpu/Implies glibc-2.32/sysdeps/sh/le/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/sh/le/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/sh/le/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+sh/sh4/fpu
-diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index 9b2a253032..34748ffcd1 100644
---- a/sysdeps/unix/sysv/linux/Makefile
-+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -100,7 +100,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
- tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
- test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
- tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
-- tst-tgkill
-+ tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux
- tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
-
- CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
-diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
-index fc688450ee..00a4d0c8e7 100644
---- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
-+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/aarch64/cpu-features.h glibc-2.32/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/aarch64/cpu-features.h 2021-09-18 21:02:32.731185676 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/aarch64/cpu-features.h 2021-09-18 21:03:05.313302322 +1000
@@ -54,6 +54,10 @@
&& MIDR_PARTNUM(midr) == 0x000)
#define IS_NEOVERSE_N1(midr) (MIDR_IMPLEMENTOR(midr) == 'A' \
@@ -5133,16 +5055,29 @@ index fc688450ee..00a4d0c8e7 100644
#define IS_EMAG(midr) (MIDR_IMPLEMENTOR(midr) == 'P' \
&& MIDR_PARTNUM(midr) == 0x000)
-diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c
-index 61bbb03b64..b5a903c3a2 100644
---- a/sysdeps/unix/sysv/linux/mq_notify.c
-+++ b/sysdeps/unix/sysv/linux/mq_notify.c
-@@ -133,8 +133,11 @@ helper_thread (void *arg)
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/Makefile glibc-2.32/sysdeps/unix/sysv/linux/Makefile
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/Makefile 2021-09-18 21:02:32.731185676 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/Makefile 2021-09-18 21:03:05.313302322 +1000
+@@ -100,7 +100,7 @@ tests += tst-clone tst-clone2 tst-clone3
+ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
+ test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
+ tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
+- tst-tgkill
++ tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux
+ tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
+
+ CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/mq_notify.c glibc-2.32/sysdeps/unix/sysv/linux/mq_notify.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/mq_notify.c 2021-09-18 21:02:32.736185847 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/mq_notify.c 2021-09-18 21:09:50.680196980 +1000
+@@ -132,9 +132,12 @@ helper_thread (void *arg)
+ to wait until it is done with it. */
(void) __pthread_barrier_wait (¬ify_barrier);
}
- else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
+- else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
- /* The only state we keep is the copy of the thread attributes. */
- free (data.attr);
++ else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED && data.attr != NULL)
+ {
+ /* The only state we keep is the copy of the thread attributes. */
+ pthread_attr_destroy (data.attr);
@@ -5151,7 +5086,7 @@ index 61bbb03b64..b5a903c3a2 100644
}
return NULL;
}
-@@ -255,8 +258,14 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
+@@ -255,8 +258,14 @@ mq_notify (mqd_t mqdes, const struct sig
if (data.attr == NULL)
return -1;
@@ -5168,7 +5103,7 @@ index 61bbb03b64..b5a903c3a2 100644
}
/* Construct the new request. */
-@@ -269,8 +278,11 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
+@@ -269,8 +278,11 @@ mq_notify (mqd_t mqdes, const struct sig
int retval = INLINE_SYSCALL (mq_notify, 2, mqdes, &se);
/* If it failed, free the allocated memory. */
@@ -5182,11 +5117,10 @@ index 61bbb03b64..b5a903c3a2 100644
return retval;
}
-diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
-index 0776472d5e..a1f24ab242 100644
---- a/sysdeps/unix/sysv/linux/msgctl.c
-+++ b/sysdeps/unix/sysv/linux/msgctl.c
-@@ -90,8 +90,15 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/msgctl.c glibc-2.32/sysdeps/unix/sysv/linux/msgctl.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/msgctl.c 2021-09-18 21:02:32.736185847 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/msgctl.c 2021-09-18 21:03:05.313302322 +1000
+@@ -90,8 +90,15 @@ __msgctl64 (int msqid, int cmd, struct _
struct kernel_msqid64_ds ksemid, *arg = NULL;
if (buf != NULL)
{
@@ -5204,7 +5138,7 @@ index 0776472d5e..a1f24ab242 100644
}
# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
if (cmd == IPC_SET)
-@@ -169,8 +176,15 @@ __msgctl (int msqid, int cmd, struct msqid_ds *buf)
+@@ -169,8 +176,15 @@ __msgctl (int msqid, int cmd, struct msq
struct __msqid64_ds msqid64, *buf64 = NULL;
if (buf != NULL)
{
@@ -5222,11 +5156,10 @@ index 0776472d5e..a1f24ab242 100644
}
int ret = __msgctl64 (msqid, cmd, buf64);
-diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
-index f131a26fc7..1cdabde8f2 100644
---- a/sysdeps/unix/sysv/linux/semctl.c
-+++ b/sysdeps/unix/sysv/linux/semctl.c
-@@ -102,6 +102,7 @@ semun64_to_ksemun64 (int cmd, union semun64 semun64,
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/semctl.c glibc-2.32/sysdeps/unix/sysv/linux/semctl.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/semctl.c 2021-09-18 21:02:32.739185950 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/semctl.c 2021-09-18 21:03:05.313302322 +1000
+@@ -102,6 +102,7 @@ semun64_to_ksemun64 (int cmd, union semu
r.array = semun64.array;
break;
case SEM_STAT:
@@ -5234,7 +5167,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_STAT:
case IPC_SET:
r.buf = buf;
-@@ -150,6 +151,7 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+@@ -150,6 +151,7 @@ __semctl64 (int semid, int semnum, int c
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -5242,7 +5175,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-@@ -238,6 +240,7 @@ semun_to_semun64 (int cmd, union semun semun, struct __semid64_ds *semid64)
+@@ -238,6 +240,7 @@ semun_to_semun64 (int cmd, union semun s
r.array = semun.array;
break;
case SEM_STAT:
@@ -5250,7 +5183,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_STAT:
case IPC_SET:
r.buf = semid64;
-@@ -267,6 +270,7 @@ __semctl (int semid, int semnum, int cmd, ...)
+@@ -267,6 +270,7 @@ __semctl (int semid, int semnum, int cmd
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -5258,7 +5191,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-@@ -321,6 +325,7 @@ __semctl_mode16 (int semid, int semnum, int cmd, ...)
+@@ -321,6 +325,7 @@ __semctl_mode16 (int semid, int semnum,
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -5266,7 +5199,7 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-@@ -354,6 +359,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
+@@ -354,6 +359,7 @@ __old_semctl (int semid, int semnum, int
case IPC_STAT: /* arg.buf */
case IPC_SET:
case SEM_STAT:
@@ -5274,25 +5207,20 @@ index f131a26fc7..1cdabde8f2 100644
case IPC_INFO: /* arg.__buf */
case SEM_INFO:
va_start (ap, cmd);
-diff --git a/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies b/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..7eeaf15a5a
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies glibc-2.32/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/sh/be/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+unix/sysv/linux/sh/sh4/fpu
-diff --git a/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies b/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies
-new file mode 100644
-index 0000000000..7eeaf15a5a
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies glibc-2.32/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/sh/le/sh4/fpu/Implies 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1 @@
+unix/sysv/linux/sh/sh4/fpu
-diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
-index 76d88441f1..1d19a798b1 100644
---- a/sysdeps/unix/sysv/linux/shmctl.c
-+++ b/sysdeps/unix/sysv/linux/shmctl.c
-@@ -90,8 +90,15 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/shmctl.c glibc-2.32/sysdeps/unix/sysv/linux/shmctl.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/shmctl.c 2021-09-18 21:02:32.740185984 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/shmctl.c 2021-09-18 21:03:05.313302322 +1000
+@@ -90,8 +90,15 @@ __shmctl64 (int shmid, int cmd, struct _
struct kernel_shmid64_ds kshmid, *arg = NULL;
if (buf != NULL)
{
@@ -5310,7 +5238,7 @@ index 76d88441f1..1d19a798b1 100644
}
# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
if (cmd == IPC_SET)
-@@ -107,7 +114,6 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+@@ -107,7 +114,6 @@ __shmctl64 (int shmid, int cmd, struct _
switch (cmd)
{
@@ -5318,7 +5246,7 @@ index 76d88441f1..1d19a798b1 100644
case IPC_STAT:
case SHM_STAT:
case SHM_STAT_ANY:
-@@ -168,8 +174,15 @@ __shmctl (int shmid, int cmd, struct shmid_ds *buf)
+@@ -168,8 +174,15 @@ __shmctl (int shmid, int cmd, struct shm
struct __shmid64_ds shmid64, *buf64 = NULL;
if (buf != NULL)
{
@@ -5336,7 +5264,7 @@ index 76d88441f1..1d19a798b1 100644
}
int ret = __shmctl64 (shmid, cmd, buf64);
-@@ -178,7 +191,6 @@ __shmctl (int shmid, int cmd, struct shmid_ds *buf)
+@@ -178,7 +191,6 @@ __shmctl (int shmid, int cmd, struct shm
switch (cmd)
{
@@ -5344,11 +5272,9 @@ index 76d88441f1..1d19a798b1 100644
case IPC_STAT:
case SHM_STAT:
case SHM_STAT_ANY:
-diff --git a/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c b/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
-new file mode 100644
-index 0000000000..630f4f792c
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c 2021-09-18 21:03:05.313302322 +1000
@@ -0,0 +1,177 @@
+/* Basic tests for Linux SYSV message queue extensions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -5527,11 +5453,9 @@ index 0000000000..630f4f792c
+}
+
+#include <support/test-driver.c>
-diff --git a/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c b/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
-new file mode 100644
-index 0000000000..45f19e2d37
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c 2021-09-18 21:03:05.314302356 +1000
@@ -0,0 +1,184 @@
+/* Basic tests for Linux SYSV semaphore extensions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -5717,11 +5641,9 @@ index 0000000000..45f19e2d37
+}
+
+#include <support/test-driver.c>
-diff --git a/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
-new file mode 100644
-index 0000000000..7128ae2e14
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c 2021-09-18 21:03:05.314302356 +1000
@@ -0,0 +1,185 @@
+/* Basic tests for Linux SYSV shared memory extensions.
+ Copyright (C) 2020 Free Software Foundation, Inc.
@@ -5908,27 +5830,41 @@ index 0000000000..7128ae2e14
+}
+
+#include <support/test-driver.c>
-diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
-index a6736aef25..9736a13e7b 100644
---- a/sysdeps/x86/Makefile
-+++ b/sysdeps/x86/Makefile
-@@ -12,6 +12,12 @@ endif
- ifeq ($(subdir),setjmp)
- gen-as-const-headers += jmp_buf-ssp.sym
- sysdep_routines += __longjmp_cancel
-+ifneq ($(enable-cet),no)
-+ifneq ($(have-tunables),no)
-+tests += tst-setjmp-cet
-+tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
-+endif
-+endif
- endif
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/64/configure glibc-2.32/sysdeps/unix/sysv/linux/x86_64/64/configure
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/64/configure 2021-09-18 21:02:32.741186019 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/x86_64/64/configure 2021-09-18 21:03:05.314302356 +1000
+@@ -4,10 +4,10 @@
+ test -n "$libc_cv_slibdir" ||
+ case "$prefix" in
+ /usr | /usr/)
+- libc_cv_slibdir='/lib64'
+- libc_cv_rtlddir='/lib64'
++ libc_cv_slibdir='/lib'
++ libc_cv_rtlddir='/lib'
+ if test "$libdir" = '${exec_prefix}/lib'; then
+- libdir='${exec_prefix}/lib64';
++ libdir='${exec_prefix}/lib';
+ # Locale data can be shared between 32-bit and 64-bit libraries.
+ libc_cv_complocaledir='${exec_prefix}/lib/locale'
+ fi
+diff -pruN glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/ldconfig.h glibc-2.32/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
+--- glibc-2.32.orig/sysdeps/unix/sysv/linux/x86_64/ldconfig.h 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/unix/sysv/linux/x86_64/ldconfig.h 2021-09-18 21:03:05.314302356 +1000
+@@ -18,9 +18,9 @@
+ #include <sysdeps/generic/ldconfig.h>
- ifeq ($(subdir),string)
-diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
-index 217c21c34f..3fb4a028d8 100644
---- a/sysdeps/x86/cacheinfo.c
-+++ b/sysdeps/x86/cacheinfo.c
+ #define SYSDEP_KNOWN_INTERPRETER_NAMES \
+- { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
++ { "/lib32/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
+ { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \
+- { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
++ { "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
+ #define SYSDEP_KNOWN_LIBRARY_NAMES \
+ { "libc.so.6", FLAG_ELF_LIBC6 }, \
+ { "libm.so.6", FLAG_ELF_LIBC6 },
+diff -pruN glibc-2.32.orig/sysdeps/x86/cacheinfo.c glibc-2.32/sysdeps/x86/cacheinfo.c
+--- glibc-2.32.orig/sysdeps/x86/cacheinfo.c 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/cacheinfo.c 2021-09-18 21:03:05.314302356 +1000
@@ -808,7 +808,7 @@ init_cacheinfo (void)
threads = 1 << ((ecx >> 12) & 0x0f);
}
@@ -5989,11 +5925,10 @@ index 217c21c34f..3fb4a028d8 100644
/* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8. */
unsigned int minimum_rep_movsb_threshold;
-diff --git a/sysdeps/x86/dl-cet.c b/sysdeps/x86/dl-cet.c
-index 03572f7af6..3cc54a8d53 100644
---- a/sysdeps/x86/dl-cet.c
-+++ b/sysdeps/x86/dl-cet.c
-@@ -47,7 +47,10 @@ dl_cet_check (struct link_map *m, const char *program)
+diff -pruN glibc-2.32.orig/sysdeps/x86/dl-cet.c glibc-2.32/sysdeps/x86/dl-cet.c
+--- glibc-2.32.orig/sysdeps/x86/dl-cet.c 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/dl-cet.c 2021-09-18 21:03:05.314302356 +1000
+@@ -47,7 +47,10 @@ dl_cet_check (struct link_map *m, const
/* No legacy object check if both IBT and SHSTK are always on. */
if (enable_ibt_type == cet_always_on
&& enable_shstk_type == cet_always_on)
@@ -6005,11 +5940,10 @@ index 03572f7af6..3cc54a8d53 100644
/* Check if IBT is enabled by kernel. */
bool ibt_enabled
-diff --git a/sysdeps/x86/dl-prop.h b/sysdeps/x86/dl-prop.h
-index 89911e19e2..4eb3b85a7b 100644
---- a/sysdeps/x86/dl-prop.h
-+++ b/sysdeps/x86/dl-prop.h
-@@ -145,15 +145,15 @@ _dl_process_cet_property_note (struct link_map *l,
+diff -pruN glibc-2.32.orig/sysdeps/x86/dl-prop.h glibc-2.32/sysdeps/x86/dl-prop.h
+--- glibc-2.32.orig/sysdeps/x86/dl-prop.h 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/dl-prop.h 2021-09-18 21:03:05.314302356 +1000
+@@ -145,15 +145,15 @@ _dl_process_cet_property_note (struct li
}
static inline void __attribute__ ((unused))
@@ -6028,20 +5962,31 @@ index 89911e19e2..4eb3b85a7b 100644
{
return 0;
}
-diff --git a/sysdeps/x86/tst-setjmp-cet.c b/sysdeps/x86/tst-setjmp-cet.c
-new file mode 100644
-index 0000000000..42c795d2a8
---- /dev/null
-+++ b/sysdeps/x86/tst-setjmp-cet.c
+diff -pruN glibc-2.32.orig/sysdeps/x86/Makefile glibc-2.32/sysdeps/x86/Makefile
+--- glibc-2.32.orig/sysdeps/x86/Makefile 2021-09-18 21:02:32.742186053 +1000
++++ glibc-2.32/sysdeps/x86/Makefile 2021-09-18 21:03:05.314302356 +1000
+@@ -12,6 +12,12 @@ endif
+ ifeq ($(subdir),setjmp)
+ gen-as-const-headers += jmp_buf-ssp.sym
+ sysdep_routines += __longjmp_cancel
++ifneq ($(enable-cet),no)
++ifneq ($(have-tunables),no)
++tests += tst-setjmp-cet
++tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
++endif
++endif
+ endif
+
+ ifeq ($(subdir),string)
+diff -pruN glibc-2.32.orig/sysdeps/x86/tst-setjmp-cet.c glibc-2.32/sysdeps/x86/tst-setjmp-cet.c
+--- glibc-2.32.orig/sysdeps/x86/tst-setjmp-cet.c 1970-01-01 10:00:00.000000000 +1000
++++ glibc-2.32/sysdeps/x86/tst-setjmp-cet.c 2021-09-18 21:03:05.314302356 +1000
@@ -0,0 +1 @@
+#include <setjmp/tst-setjmp.c>
-diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
-old mode 100644
-new mode 100755
-index 84f82c2406..fc1840e23f
---- a/sysdeps/x86_64/configure
-+++ b/sysdeps/x86_64/configure
-@@ -107,39 +107,6 @@ if test x"$build_mathvec" = xnotset; then
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/configure glibc-2.32/sysdeps/x86_64/configure
+--- glibc-2.32.orig/sysdeps/x86_64/configure 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/configure 2021-09-18 21:03:05.314302356 +1000
+@@ -107,39 +107,6 @@ if test x"$build_mathvec" = xnotset; the
build_mathvec=yes
fi
@@ -6081,11 +6026,10 @@ index 84f82c2406..fc1840e23f
$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
-diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
-index cdaba0c075..611a7d9ba3 100644
---- a/sysdeps/x86_64/configure.ac
-+++ b/sysdeps/x86_64/configure.ac
-@@ -53,31 +53,6 @@ if test x"$build_mathvec" = xnotset; then
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/configure.ac glibc-2.32/sysdeps/x86_64/configure.ac
+--- glibc-2.32.orig/sysdeps/x86_64/configure.ac 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/configure.ac 2021-09-18 21:03:05.314302356 +1000
+@@ -53,31 +53,6 @@ if test x"$build_mathvec" = xnotset; the
build_mathvec=yes
fi
@@ -6117,11 +6061,10 @@ index cdaba0c075..611a7d9ba3 100644
dnl It is always possible to access static and hidden symbols in an
dnl position independent way.
AC_DEFINE(PI_STATIC_AND_HIDDEN)
-diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
-index ca73d8fef9..363a749cb2 100644
---- a/sysdeps/x86_64/dl-machine.h
-+++ b/sysdeps/x86_64/dl-machine.h
-@@ -315,16 +315,22 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/dl-machine.h glibc-2.32/sysdeps/x86_64/dl-machine.h
+--- glibc-2.32.orig/sysdeps/x86_64/dl-machine.h 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/dl-machine.h 2021-09-18 21:03:05.314302356 +1000
+@@ -315,16 +315,22 @@ elf_machine_rela (struct link_map *map,
{
# ifndef RTLD_BOOTSTRAP
if (sym_map != map
@@ -6149,10 +6092,9 @@ index ca73d8fef9..363a749cb2 100644
}
# endif
value = ((ElfW(Addr) (*) (void)) value) ();
-diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
-index 7659758972..e5fd5ac9cb 100644
---- a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
-+++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h glibc-2.32/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
+--- glibc-2.32.orig/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h 2021-09-18 21:02:32.743186087 +1000
++++ glibc-2.32/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h 2021-09-18 21:03:05.314302356 +1000
@@ -32,7 +32,7 @@ IFUNC_SELECTOR (void)
&& CPU_FEATURE_USABLE_P (cpu_features, AVX2))
return OPTIMIZE (fma);
@@ -6162,10 +6104,9 @@ index 7659758972..e5fd5ac9cb 100644
return OPTIMIZE (fma4);
return OPTIMIZE (sse2);
-diff --git a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
-index bd5dc1a3f3..092f364bb6 100644
---- a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
-+++ b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
+diff -pruN glibc-2.32.orig/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S glibc-2.32/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
+--- glibc-2.32.orig/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S 2021-09-18 21:02:32.745186156 +1000
++++ glibc-2.32/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S 2021-09-18 21:03:05.314302356 +1000
@@ -56,6 +56,13 @@
# endif
#endif
@@ -6202,10 +6143,9 @@ index bd5dc1a3f3..092f364bb6 100644
mov %RDX_LP, %RCX_LP
rep movsb
L(nop):
-diff --git a/sysvipc/test-sysvsem.c b/sysvipc/test-sysvsem.c
-index 01dbff343a..b7284e0b48 100644
---- a/sysvipc/test-sysvsem.c
-+++ b/sysvipc/test-sysvsem.c
+diff -pruN glibc-2.32.orig/sysvipc/test-sysvsem.c glibc-2.32/sysvipc/test-sysvsem.c
+--- glibc-2.32.orig/sysvipc/test-sysvsem.c 2021-09-18 21:02:32.746186190 +1000
++++ glibc-2.32/sysvipc/test-sysvsem.c 2021-09-18 21:03:05.314302356 +1000
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <errno.h>
@@ -6214,47 +6154,12 @@ index 01dbff343a..b7284e0b48 100644
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
-diff --git a/version.h b/version.h
-index 83cd196798..e6ca7a8857 100644
---- a/version.h
-+++ b/version.h
+diff -pruN glibc-2.32.orig/version.h glibc-2.32/version.h
+--- glibc-2.32.orig/version.h 2021-09-18 21:02:32.746186190 +1000
++++ glibc-2.32/version.h 2021-09-18 21:03:05.314302356 +1000
@@ -1,4 +1,4 @@
/* This file just defines the current version number of libc. */
-#define RELEASE "release"
+#define RELEASE "stable"
#define VERSION "2.32"
-diff --git a/sysdeps/unix/sysv/linux/x86_64/64/configure b/sysdeps/unix/sysv/linux/x86_64/64/configure
-index 9d298faba7..cef1ec842c 100644
---- a/sysdeps/unix/sysv/linux/x86_64/64/configure
-+++ b/sysdeps/unix/sysv/linux/x86_64/64/configure
-@@ -4,10 +4,10 @@
- test -n "$libc_cv_slibdir" ||
- case "$prefix" in
- /usr | /usr/)
-- libc_cv_slibdir='/lib64'
-- libc_cv_rtlddir='/lib64'
-+ libc_cv_slibdir='/lib'
-+ libc_cv_rtlddir='/lib'
- if test "$libdir" = '${exec_prefix}/lib'; then
-- libdir='${exec_prefix}/lib64';
-+ libdir='${exec_prefix}/lib';
- # Locale data can be shared between 32-bit and 64-bit libraries.
- libc_cv_complocaledir='${exec_prefix}/lib/locale'
- fi
-diff --git a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
-index 062c04689d..7783757726 100644
---- a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
-+++ b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
-@@ -18,9 +18,9 @@
- #include <sysdeps/generic/ldconfig.h>
-
- #define SYSDEP_KNOWN_INTERPRETER_NAMES \
-- { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
-+ { "/lib32/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
- { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \
-- { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
-+ { "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
- #define SYSDEP_KNOWN_LIBRARY_NAMES \
- { "libc.so.6", FLAG_ELF_LIBC6 }, \
- { "libm.so.6", FLAG_ELF_LIBC6 },
1
0
18 Sep '21
commit 77ef220413e04c1190d13463586104e3cf610a12
Author: Danny Rawlins <contact(a)romster.me>
Date: Sat Sep 18 17:08:17 2021 +1000
[notify] flac: security fix for CVE-2020-0499
diff --git a/flac/.signature b/flac/.signature
index a6c6320fb..7f0fff74a 100644
--- a/flac/.signature
+++ b/flac/.signature
@@ -1,5 +1,7 @@
untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/RXGEQQsM7jj9a2XgMwJduX3cjXGm3hkD9LVGeloGKU/CEXW3mnA05NbCYUQI48BY1Xpz9/faXs46z7qwyVUTgs=
-SHA256 (Pkgfile) = 7051386c258bb4bc1f4394fa0fea2e22e5d698e8b53c14e5cde6deb0b36e880e
+RWSE3ohX2g5d/Uxh4j/6PEOv3zoJy43TDAwlkCC7uje5YLqSKUNMxXBdNiDaF0rquUbwnvlnyuX7NEE/xAJixVnV3pn2HA+V7Aw=
+SHA256 (Pkgfile) = 7e94e96a7c807506dc3ecd9b5f94dcdd816d108b2c22a4e9ba892b738327e577
SHA256 (.footprint) = 1b4686b5a9615a67c8c91b0b51f2e1688c245bf737e0d2772231bcd502d96004
SHA256 (flac-1.3.3.tar.xz) = 213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748
+SHA256 (2e7931c.patch) = 4c720576c909cb0a624dba339285970bc01488b19a875333fdc74b43e1c020ba
+SHA256 (ced7f68.patch) = f41722979b57c4fd9cc80018af90e035f0ecacbfb5cbe8161838c01d58879047
diff --git a/flac/2e7931c.patch b/flac/2e7931c.patch
new file mode 100644
index 000000000..53556bbca
--- /dev/null
+++ b/flac/2e7931c.patch
@@ -0,0 +1,25 @@
+From 2e7931c27eb15e387da440a37f12437e35b22dd4 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd(a)mega-nerd.com>
+Date: Mon, 7 Oct 2019 12:55:58 +1100
+Subject: [PATCH] libFLAC/bitreader.c: Fix out-of-bounds read
+
+Credit: Oss-Fuzz
+Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17069
+Testcase: fuzzer_decoder-5670265022840832
+---
+ src/libFLAC/bitreader.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c
+index 5e4b59180e..3df4d02c0b 100644
+--- a/src/libFLAC/bitreader.c
++++ b/src/libFLAC/bitreader.c
+@@ -869,7 +869,7 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[
+ cwords = br->consumed_words;
+ words = br->words;
+ ucbits = FLAC__BITS_PER_WORD - br->consumed_bits;
+- b = br->buffer[cwords] << br->consumed_bits;
++ b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0;
+ } while(cwords >= words && val < end);
+ }
+
diff --git a/flac/Pkgfile b/flac/Pkgfile
index 3d2b54407..7c9d40f81 100644
--- a/flac/Pkgfile
+++ b/flac/Pkgfile
@@ -5,12 +5,17 @@
name=flac
version=1.3.3
-release=1
-source=(https://downloads.xiph.org/releases/flac/$name-$version.tar.xz)
+release=2
+source=(https://downloads.xiph.org/releases/flac/$name-$version.tar.xz
+ 2e7931c.patch
+ ced7f68.patch)
build() {
cd $name-$version
+ patch -p1 -i $SRC/2e7931c.patch # CVE-2020-0499
+ patch -p1 -i $SRC/ced7f68.patch # overflow checks
+
./configure --prefix=/usr
make
diff --git a/flac/ced7f68.patch b/flac/ced7f68.patch
new file mode 100644
index 000000000..eb2b7871b
--- /dev/null
+++ b/flac/ced7f68.patch
@@ -0,0 +1,74 @@
+From ced7f6829d14e38128bf0ba66412cc0541246c46 Mon Sep 17 00:00:00 2001
+From: Martijn van Beurden <mvanb1(a)gmail.com>
+Date: Mon, 6 Jul 2020 21:38:39 +0200
+Subject: [PATCH] Add some overflow checks for residual bits calculation
+
+---
+ src/libFLAC/stream_encoder.c | 23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
+index 74387ec3be..4c91247fe8 100644
+--- a/src/libFLAC/stream_encoder.c
++++ b/src/libFLAC/stream_encoder.c
+@@ -4110,13 +4110,14 @@ static inline uint32_t count_rice_bits_in_partition_(
+ const FLAC__int32 *residual
+ )
+ {
+- uint32_t i, partition_bits =
++ uint32_t i;
++ uint64_t partition_bits =
+ FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN + /* actually could end up being FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN but err on side of 16bps */
+ (1+rice_parameter) * partition_samples /* 1 for unary stop bit + rice_parameter for the binary portion */
+ ;
+ for(i = 0; i < partition_samples; i++)
+ partition_bits += ( (FLAC__uint32)((residual[i]<<1)^(residual[i]>>31)) >> rice_parameter );
+- return partition_bits;
++ return (uint32_t)(flac_min(partition_bits,(uint32_t)(-1))); // To make sure the return value doesn't overflow
+ }
+ #else
+ static inline uint32_t count_rice_bits_in_partition_(
+@@ -4125,15 +4126,15 @@ static inline uint32_t count_rice_bits_in_partition_(
+ const FLAC__uint64 abs_residual_partition_sum
+ )
+ {
+- return
++ return (uint32_t)(flac_min( // To make sure the return value doesn't overflow
+ FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN + /* actually could end up being FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN but err on side of 16bps */
+ (1+rice_parameter) * partition_samples + /* 1 for unary stop bit + rice_parameter for the binary portion */
+ (
+ rice_parameter?
+- (uint32_t)(abs_residual_partition_sum >> (rice_parameter-1)) /* rice_parameter-1 because the real coder sign-folds instead of using a sign bit */
+- : (uint32_t)(abs_residual_partition_sum << 1) /* can't shift by negative number, so reverse */
++ (abs_residual_partition_sum >> (rice_parameter-1)) /* rice_parameter-1 because the real coder sign-folds instead of using a sign bit */
++ : (abs_residual_partition_sum << 1) /* can't shift by negative number, so reverse */
+ )
+- - (partition_samples >> 1)
++ - (partition_samples >> 1),(uint32_t)(-1)));
+ /* -(partition_samples>>1) to subtract out extra contributions to the abs_residual_partition_sum.
+ * The actual number of bits used is closer to the sum(for all i in the partition) of abs(residual[i])>>(rice_parameter-1)
+ * By using the abs_residual_partition sum, we also add in bits in the LSBs that would normally be shifted out.
+@@ -4224,7 +4225,10 @@ FLAC__bool set_partitioned_rice_(
+ raw_bits[0] = 0;
+ }
+ parameters[0] = best_rice_parameter;
+- bits_ += best_partition_bits;
++ if(best_partition_bits < UINT_MAX - bits_) // To make sure _bits doesn't overflow
++ bits_ += best_partition_bits;
++ else
++ bits_ = UINT_MAX;
+ }
+ else {
+ uint32_t partition, residual_sample;
+@@ -4327,7 +4331,10 @@ FLAC__bool set_partitioned_rice_(
+ raw_bits[partition] = 0;
+ }
+ parameters[partition] = best_rice_parameter;
+- bits_ += best_partition_bits;
++ if(best_partition_bits < UINT_MAX - bits_) // To make sure _bits doesn't overflow
++ bits_ += best_partition_bits;
++ else
++ bits_ = UINT_MAX;
+ residual_sample += partition_samples;
+ }
+ }
1
0