diff -Nru glibc-2.23/debian/changelog glibc-2.23/debian/changelog --- glibc-2.23/debian/changelog 2016-03-23 00:47:35.000000000 +0000 +++ glibc-2.23/debian/changelog 2016-04-14 18:44:50.000000000 +0000 @@ -1,3 +1,34 @@ +glibc (2.23-0ubuntu3) xenial; urgency=medium + + * Merge with 2.23 from experimental, bringing in upstream updates: + - Save/restore fprs/vrs while resolving symbols (LP: #1564918) + - Fix _nss_dns_getnetbyname_r() stack overflow (CVE-2016-3075) + - Merge libnss-dns-udeb and libnss-files-udeb into libc6-udeb. + * Tidy up locale-gen, thanks to Gunnar Hjalmarsson (LP: #1560577): + - Fix thinko that broke handling of multiple locale arguments. + - Recognize UTF-8 locales without charset suffix in SUPPORTED. + - Fix bug that led to the unsupported message not being shown. + * Show reboot-required notification for all updates (LP: #1546457) + + -- Adam Conrad Thu, 14 Apr 2016 10:26:16 -0600 + +glibc (2.23-0experimental2) experimental; urgency=medium + + [ Aurelien Jarno ] + * debian/patches/git-updates.diff: update from upstream stable branch. + * patches/kfreebsd/local-fbtl.diff: update to revision 5973 (from + glibc-bsd). + * debian/rules, debian/rules.d/build.mk: rename localedir into complocaledir + following upstream change. + * debian/patches/local-allocalim-header.diff: drop, obsolete. + * debian/patches/any/local-no-pagesize.diff: drop, obsolete. + + [ Adam Conrad ] + * debian/testsuite-xfail-debian.mk: Also allow tst-malloc-thread-fail to + fail where we've already done so for test-xfail-tst-malloc-thread-exit. + + -- Aurelien Jarno Thu, 14 Apr 2016 14:20:30 +0200 + glibc (2.23-0ubuntu2) xenial; urgency=medium * Merge with 2.23 from experimental, bringing in upstream updates. @@ -72,7 +103,7 @@ -- Adam Conrad Thu, 17 Mar 2016 05:18:44 -0600 -glibc (2.23-0experimental1) UNRELEASED; urgency=medium +glibc (2.23-0experimental1) experimental; urgency=medium [ Aurelien Jarno ] * debian/patches/git-updates.diff: update from upstream stable branch. @@ -86,6 +117,8 @@ hurd-i386/cvs-libpthread.so.diff. * debian/patches/kfreebsd/local-tst-unique.diff: disable tst-unique* on GNU/kFreeBSD, as they are not supported by the FreeBSD ELF OSABI. + * debian/patches/alpha/submitted-fts64.diff: new patch to fix the new fts64 + function on alpha. [ Samuel Thibault ] * hurd-i386/cvs-libpthread.diff: More updates to glibc-2.23. @@ -112,7 +145,7 @@ * debian/control.in/i386: Remove list of Breaks that predate oldstable. * debian/control.in/*: Drop long obsolete file overlap Breaks/Replaces. - -- Aurelien Jarno Mon, 14 Mar 2016 00:14:11 +0100 + -- Aurelien Jarno Thu, 24 Mar 2016 00:21:05 +0100 glibc (2.23-0experimental0) experimental; urgency=medium @@ -197,6 +230,37 @@ -- Aurelien Jarno Sun, 13 Mar 2016 19:22:45 +0100 +glibc (2.22-6) unstable; urgency=medium + + [ Samuel Thibault ] + * hurd-i386/submitted-auxv.diff: New patch, fixes cvs crash. + * hurd-i386/submitted-anon-mmap-shared.diff: New patch, fixes inheritence of + shared anonymous memory. + + [ Aurelien Jarno ] + * Update from upstream stable branch: + - Fix stack overflow when getnetbyname is invoked on a very long name + (CVE-2016-3075). + - Fix HTM on powerpc/ppc64/ppc64el. + + -- Aurelien Jarno Sat, 09 Apr 2016 13:35:19 +0200 + +glibc (2.22-5) unstable; urgency=medium + + [ Samuel Thibault ] + * testsuite-xfail-debian.mk: Disable the problematic test-lfs test on hurd. + + [ Aurelien Jarno ] + * Update from upstream stable branch: + - Fix assertion failure with unconnectable name server addresses. Closes: + #816669. + * Drop libnss-dns-udeb and libnss-files-udeb and merge the files they + include in libc6-udeb. + * debian/patches/any/cvs-sys-personality-h.diff: new patch to synchronise + with kernel headers. Closes: #697456. + + -- Aurelien Jarno Tue, 29 Mar 2016 00:44:21 +0200 + glibc (2.22-4) unstable; urgency=medium [ Aurelien Jarno ] diff -Nru glibc-2.23/debian/control glibc-2.23/debian/control --- glibc-2.23/debian/control 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/control 2016-04-14 16:23:08.000000000 +0000 @@ -233,7 +233,7 @@ Architecture: amd64 arm64 armel armhf hppa i386 m68k mips mipsel mipsn32 mipsn32el mips64 mips64el nios2 powerpc powerpcspe ppc64 ppc64el sparc sparc64 s390x sh4 x32 Section: debian-installer Priority: extra -Provides: libc6, libc-udeb, ${locale-compat:Depends} +Provides: libc6, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends} Build-Profiles: Description: GNU C Library: Shared libraries - udeb Contains the standard libraries that are used by nearly all programs on @@ -320,7 +320,7 @@ Architecture: alpha Section: debian-installer Priority: extra -Provides: libc6.1, libc-udeb, ${locale-compat:Depends} +Provides: libc6.1, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends} Build-Profiles: Description: GNU C Library: Shared libraries - udeb Contains the standard libraries that are used by nearly all programs on @@ -407,7 +407,7 @@ Architecture: hurd-i386 Section: debian-installer Priority: extra -Provides: libc0.3, libc-udeb, ${locale-compat:Depends} +Provides: libc0.3, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends} Build-Profiles: Description: GNU C Library: Shared libraries - udeb Contains the standard libraries that are used by nearly all programs on @@ -494,7 +494,7 @@ Architecture: kfreebsd-amd64 kfreebsd-i386 Section: debian-installer Priority: extra -Provides: libc0.1, libc-udeb, ${locale-compat:Depends} +Provides: libc0.1, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends} Build-Profiles: Description: GNU C Library: Shared libraries - udeb Contains the standard libraries that are used by nearly all programs on @@ -911,31 +911,3 @@ needs to be installed on Alpha EV67/68 and EV7 machines. If you install this on an older machine, it won't even be used. -Package: libnss-dns-udeb -Package-Type: udeb -Architecture: any -Section: debian-installer -Priority: extra -Build-Profiles: -Description: GNU C Library: NSS helper for DNS - udeb - Contains the standard libraries that are used by nearly all programs on - the system. This package includes shared versions of the standard C library - and the standard math library, as well as many others. - . - This package contains the DNS NSS helper needed for the Debian installer. - Do not install it on a normal system. - -Package: libnss-files-udeb -Package-Type: udeb -Architecture: any -Section: debian-installer -Priority: extra -Build-Profiles: -Description: GNU C Library: NSS helper for files - udeb - Contains the standard libraries that are used by nearly all programs on - the system. This package includes shared versions of the standard C library - and the standard math library, as well as many others. - . - This package contains the files NSS helper needed for the Debian installer. - Do not install it on a normal system. - diff -Nru glibc-2.23/debian/control.in/libc glibc-2.23/debian/control.in/libc --- glibc-2.23/debian/control.in/libc 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/control.in/libc 2016-04-14 16:23:08.000000000 +0000 @@ -75,7 +75,7 @@ Architecture: @archs@ Section: debian-installer Priority: extra -Provides: @libc@, libc-udeb, ${locale-compat:Depends} +Provides: @libc@, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends} Build-Profiles: Description: GNU C Library: Shared libraries - udeb Contains the standard libraries that are used by nearly all programs on diff -Nru glibc-2.23/debian/control.in/libnss-dns-udeb glibc-2.23/debian/control.in/libnss-dns-udeb --- glibc-2.23/debian/control.in/libnss-dns-udeb 2016-03-10 10:14:20.000000000 +0000 +++ glibc-2.23/debian/control.in/libnss-dns-udeb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Package: libnss-dns-udeb -Package-Type: udeb -Architecture: any -Section: debian-installer -Priority: extra -Build-Profiles: -Description: GNU C Library: NSS helper for DNS - udeb - Contains the standard libraries that are used by nearly all programs on - the system. This package includes shared versions of the standard C library - and the standard math library, as well as many others. - . - This package contains the DNS NSS helper needed for the Debian installer. - Do not install it on a normal system. - diff -Nru glibc-2.23/debian/control.in/libnss-files-udeb glibc-2.23/debian/control.in/libnss-files-udeb --- glibc-2.23/debian/control.in/libnss-files-udeb 2016-03-10 10:14:20.000000000 +0000 +++ glibc-2.23/debian/control.in/libnss-files-udeb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Package: libnss-files-udeb -Package-Type: udeb -Architecture: any -Section: debian-installer -Priority: extra -Build-Profiles: -Description: GNU C Library: NSS helper for files - udeb - Contains the standard libraries that are used by nearly all programs on - the system. This package includes shared versions of the standard C library - and the standard math library, as well as many others. - . - This package contains the files NSS helper needed for the Debian installer. - Do not install it on a normal system. - diff -Nru glibc-2.23/debian/debhelper.in/libc.postinst glibc-2.23/debian/debhelper.in/libc.postinst --- glibc-2.23/debian/debhelper.in/libc.postinst 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/debhelper.in/libc.postinst 2016-04-14 16:59:25.000000000 +0000 @@ -86,10 +86,6 @@ ln -sf spool/mail /var/mail fi if dpkg --compare-versions "$preversion" lt GLIBC_VERSION; then - # give a reboot notification on major version upgrades - if [ -x /usr/share/update-notifier/notify-reboot-required ]; then - /usr/share/update-notifier/notify-reboot-required - fi check="" [ -f /var/run/services.need_restart ] && check=$(cat /var/run/services.need_restart 2>/dev/null) # Change service names back into package names, so that we can @@ -184,6 +180,10 @@ echo "Nothing to restart." fi fi # end upgrading and $preversion lt GLIBC_VERSION + # give a reboot notification on al upgrades (LP: #1546457) + if [ -x /usr/share/update-notifier/notify-reboot-required ]; then + /usr/share/update-notifier/notify-reboot-required + fi fi # Upgrading # Restart init. Currently handles chroots, systemd and upstart, and diff -Nru glibc-2.23/debian/debhelper.in/libc-udeb.install glibc-2.23/debian/debhelper.in/libc-udeb.install --- glibc-2.23/debian/debhelper.in/libc-udeb.install 2016-03-10 10:14:20.000000000 +0000 +++ glibc-2.23/debian/debhelper.in/libc-udeb.install 2016-04-14 16:23:01.000000000 +0000 @@ -12,4 +12,5 @@ TMPDIR/SLIBDIR/libcrypt* lib TMPDIR/SLIBDIR/librt*.so* lib TMPDIR/SLIBDIR/libpthread*.so* lib - +TMPDIR/SLIBDIR/libnss_dns*.so* lib +TMPDIR/SLIBDIR/libnss_files*.so* lib diff -Nru glibc-2.23/debian/debhelper.in/libnss-dns-udeb.install glibc-2.23/debian/debhelper.in/libnss-dns-udeb.install --- glibc-2.23/debian/debhelper.in/libnss-dns-udeb.install 2016-01-27 14:17:05.000000000 +0000 +++ glibc-2.23/debian/debhelper.in/libnss-dns-udeb.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# FIXME: someday we may need to handle installing into non-lib. -TMPDIR/SLIBDIR/libnss_dns*.so* lib - diff -Nru glibc-2.23/debian/debhelper.in/libnss-files-udeb.install glibc-2.23/debian/debhelper.in/libnss-files-udeb.install --- glibc-2.23/debian/debhelper.in/libnss-files-udeb.install 2016-01-27 14:17:05.000000000 +0000 +++ glibc-2.23/debian/debhelper.in/libnss-files-udeb.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# FIXME: someday we may need to handle installing into non-lib. -TMPDIR/SLIBDIR/libnss_files*.so* lib - diff -Nru glibc-2.23/debian/local/usr_sbin/locale-gen glibc-2.23/debian/local/usr_sbin/locale-gen --- glibc-2.23/debian/local/usr_sbin/locale-gen 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/local/usr_sbin/locale-gen 2016-04-14 18:33:40.000000000 +0000 @@ -121,31 +121,37 @@ done } -GENERATE= if [ -z "$1" ]; then - GENERATE="`cat $SUPPORTED/* $LOCALEGEN 2>/dev/null || true`" + GENERATE="`cat $SUPPORTED/* $LOCALEGEN 2>/dev/null || true`" else + GENERATE= while [ -n "$1" ]; do if [ -f "$SUPPORTED/$1" ]; then - GENERATE="`cat $SUPPORTED/$1`" + GENERATE="$GENERATE\n`cat $SUPPORTED/$1`" elif [ $IS_LANG = no ] && L=`grep "^${1/%.utf8/.UTF-8} " /usr/share/i18n/SUPPORTED`; then - GENERATE="$L" - add_to_locale_gen "$GENERATE" + # convert utf8 to UTF-8 and check if the requested locale exists + GENERATE="$GENERATE\n$L" + add_to_locale_gen "$L" + elif [ $IS_LANG = no ] && L=`grep "^${1%.[uU][tT][fF]*} UTF-8" /usr/share/i18n/SUPPORTED`; then + # recognize 'll_CC.UTF-8' or 'll_CC.utf8' as ll_CC without codeset + GENERATE="$GENERATE\n$L" + add_to_locale_gen "$L" else # try to come up with a sensible default - GENERATE=`grep -E "^${1}( |[._@][^[:space:]]* )UTF-8" /usr/share/i18n/SUPPORTED` - if [ -z "$GENERATE" ]; then + L=`grep -E "^${1}( |[._@][^[:space:]]* )UTF-8" /usr/share/i18n/SUPPORTED || true` + if [ -z "$L" ]; then echo "Error: '$1' is not a supported language or locale" >&2 exit 1 fi - add_to_locale_gen "$GENERATE" + GENERATE="$GENERATE\n$L" + add_to_locale_gen "$L" fi shift done fi echo "Generating locales (this might take a while)..." -echo "$GENERATE" | sort -u | while read locale charset; do \ +echo -e "$GENERATE" | sort -u | while read locale charset; do \ case $locale in \#*) continue;; "") continue;; esac; \ is_entry_ok || continue if [ "$KEEP" ] && PERL_BADLANG=0 perl -MPOSIX -e \ diff -Nru glibc-2.23/debian/patches/alpha/submitted-fts64.diff glibc-2.23/debian/patches/alpha/submitted-fts64.diff --- glibc-2.23/debian/patches/alpha/submitted-fts64.diff 1970-01-01 00:00:00.000000000 +0000 +++ glibc-2.23/debian/patches/alpha/submitted-fts64.diff 2016-03-24 03:56:44.000000000 +0000 @@ -0,0 +1,13 @@ +2016-03-22 Aurelien Jarno + + * sysdeps/unix/sysv/linux/alpha/fts.c: New file. + * sysdeps/unix/sysv/linux/alpha/fts64.c: New file. + +--- /dev/null ++++ b/sysdeps/unix/sysv/linux/alpha/fts.c +@@ -0,0 +1 @@ ++#include +--- /dev/null ++++ b/sysdeps/unix/sysv/linux/alpha/fts64.c +@@ -0,0 +1 @@ ++#include diff -Nru glibc-2.23/debian/patches/any/cvs-sys-personality-h.diff glibc-2.23/debian/patches/any/cvs-sys-personality-h.diff --- glibc-2.23/debian/patches/any/cvs-sys-personality-h.diff 1970-01-01 00:00:00.000000000 +0000 +++ glibc-2.23/debian/patches/any/cvs-sys-personality-h.diff 2016-04-14 16:23:01.000000000 +0000 @@ -0,0 +1,25 @@ +2016-03-28 Aurelien Jarno + + * sysdeps/unix/sysv/linux/sys/personality.h (UNAME26, FDPIC_FUNCPTRS, + PER_LINUX_FDPIC): Add. + +--- a/sysdeps/unix/sysv/linux/sys/personality.h ++++ b/sysdeps/unix/sysv/linux/sys/personality.h +@@ -26,7 +26,9 @@ + These occupy the top three bytes. */ + enum + { ++ UNAME26 = 0x0020000, + ADDR_NO_RANDOMIZE = 0x0040000, ++ FDPIC_FUNCPTRS = 0x0080000, + MMAP_PAGE_ZERO = 0x0100000, + ADDR_COMPAT_LAYOUT = 0x0200000, + READ_IMPLIES_EXEC = 0x0400000, +@@ -45,6 +47,7 @@ enum + { + PER_LINUX = 0x0000, + PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT, ++ PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS, + PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, + PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE, + PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE, diff -Nru glibc-2.23/debian/patches/any/local-allocalim-header.diff glibc-2.23/debian/patches/any/local-allocalim-header.diff --- glibc-2.23/debian/patches/any/local-allocalim-header.diff 2016-01-27 14:17:05.000000000 +0000 +++ glibc-2.23/debian/patches/any/local-allocalim-header.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ ---- - sysdeps/unix/sysv/linux/check_pf.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/sysdeps/unix/sysv/linux/check_pf.c -+++ b/sysdeps/unix/sysv/linux/check_pf.c -@@ -24,6 +24,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - diff -Nru glibc-2.23/debian/patches/any/local-no-pagesize.diff glibc-2.23/debian/patches/any/local-no-pagesize.diff --- glibc-2.23/debian/patches/any/local-no-pagesize.diff 2016-03-10 10:14:20.000000000 +0000 +++ glibc-2.23/debian/patches/any/local-no-pagesize.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ ---- - sysdeps/unix/sysv/linux/check_native.c | 6 ------ - sysdeps/unix/sysv/linux/check_pf.c | 6 ------ - sysdeps/unix/sysv/linux/ifaddrs.c | 6 ------ - sysdeps/unix/sysv/linux/x86/sys/user.h | 2 ++ - 6 files changed, 6 insertions(+), 21 deletions(-) - ---- a/sysdeps/unix/sysv/linux/x86/sys/user.h -+++ b/sysdeps/unix/sysv/linux/x86/sys/user.h -@@ -22,6 +22,8 @@ - too much into it. Don't use it for anything other than GDB unless - you know what you are doing. */ - -+#include -+ - #ifdef __x86_64__ - - struct user_fpregs_struct ---- a/sysdeps/unix/sysv/linux/check_native.c -+++ b/sysdeps/unix/sysv/linux/check_native.c -@@ -77,13 +77,7 @@ - memset (&nladdr, '\0', sizeof (nladdr)); - nladdr.nl_family = AF_NETLINK; - --#ifdef PAGE_SIZE -- /* Help the compiler optimize out the malloc call if PAGE_SIZE -- is constant and smaller or equal to PTHREAD_STACK_MIN/4. */ -- const size_t buf_size = PAGE_SIZE; --#else - const size_t buf_size = __getpagesize (); --#endif - bool use_malloc = false; - char *buf; - ---- a/sysdeps/unix/sysv/linux/ifaddrs.c -+++ b/sysdeps/unix/sysv/linux/ifaddrs.c -@@ -143,13 +143,7 @@ - ssize_t read_len; - bool done = false; - --#ifdef PAGE_SIZE -- /* Help the compiler optimize out the malloc call if PAGE_SIZE -- is constant and smaller or equal to PTHREAD_STACK_MIN/4. */ -- const size_t buf_size = PAGE_SIZE; --#else - const size_t buf_size = __getpagesize (); --#endif - bool use_malloc = false; - char *buf; - diff -Nru glibc-2.23/debian/patches/git-updates.diff glibc-2.23/debian/patches/git-updates.diff --- glibc-2.23/debian/patches/git-updates.diff 2016-03-22 21:03:52.000000000 +0000 +++ glibc-2.23/debian/patches/git-updates.diff 2016-04-14 16:23:01.000000000 +0000 @@ -1,10 +1,58 @@ GIT update of git://sourceware.org/git/glibc.git/release/2.23/master from glibc-2.23 diff --git a/ChangeLog b/ChangeLog -index 2e4afb7..70553ea 100644 +index 2e4afb7..4a0461d 100644 --- a/ChangeLog +++ b/ChangeLog -@@ -1,5 +1,122 @@ +@@ -1,5 +1,170 @@ ++2016-04-01 Florian Weimer ++ ++ [BZ #19879] ++ CVE-2016-3075 ++ * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r): Do not ++ copy name. ++ ++2016-04-01 Stefan Liebler ++ ++ * sysdeps/s390/bits/link.h: (La_s390_vr) New typedef. ++ (La_s390_32_regs): Append vector register lr_v24-lr_v31. ++ (La_s390_64_regs): Likewise. ++ (La_s390_32_retval): Append vector register lrv_v24. ++ (La_s390_64_retval): Likeweise. ++ * sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_profile): ++ Handle extended structs La_s390_32_regs and La_s390_32_retval. ++ * sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_profile): ++ Handle extended structs La_s390_64_regs and La_s390_64_retval. ++ ++2016-04-01 Stefan Liebler ++ ++ * sysdeps/s390/s390-32/dl-trampoline.S: Include dl-trampoline.h twice ++ to create a non-vector/vector version for _dl_runtime_resolve and ++ _dl_runtime_profile. Move implementation to ... ++ * sysdeps/s390/s390-32/dl-trampoline.h: ... here. ++ (_dl_runtime_resolve) Save and restore fpr/vrs. ++ (_dl_runtime_profile) Save and restore vrs and fix some issues ++ if _dl_call_pltexit is called. ++ * sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup): ++ Choose the correct resolver function if running on a machine with vx. ++ * sysdeps/s390/s390-64/dl-trampoline.S: Include dl-trampoline.h twice ++ to create a non-vector/vector version for _dl_runtime_resolve and ++ _dl_runtime_profile. Move implementation to ... ++ * sysdeps/s390/s390-64/dl-trampoline.h: ... here. ++ (_dl_runtime_resolve) Save and restore fpr/vrs. ++ (_dl_runtime_profile) Save and restore vrs and fix some issues ++ * sysdeps/s390/s390-64/dl-machine.h: (elf_machine_runtime_setup): ++ Choose the correct resolver function if running on a machine with vx. ++ ++2016-03-25 Florian Weimer ++ ++ [BZ #19791] ++ * resolv/res_send.c (close_and_return_error): New function. ++ (send_dg): Initialize *resplen2 after reopen failure. Call ++ close_and_return_error for error returns. On error paths without ++ __res_iclose, initialze *resplen2 explicitly. Update comment for ++ successful return. ++ +2016-03-21 Dylan Alex Simon + + [BZ #19822] @@ -128,10 +176,10 @@ (VERSION): Set to 2.23. * include/feature.h (__GLIBC_MINOR__): Set to 23. diff --git a/NEWS b/NEWS -index c0276cf..db5ee12 100644 +index c0276cf..a08f96b 100644 --- a/NEWS +++ b/NEWS -@@ -5,6 +5,22 @@ See the end for copying conditions. +@@ -5,6 +5,29 @@ See the end for copying conditions. Please send GNU C library bug reports via using `glibc' in the "product" field. @@ -139,7 +187,10 @@ + +Security related changes: + -+ [Add security related changes here] ++* The getnetbyname implementation in nss_dns had a potentially unbounded ++ alloca call (in the form of a call to strdupa), leading to a stack ++ overflow (stack exhaustion) and a crash if getnetbyname is invoked ++ on a very long name. (CVE-2016-3075) + +The following bugs are resolved with this release: + @@ -147,14 +198,18 @@ + [19758] Or bit_Prefer_MAP_32BIT_EXEC in EXTRA_LD_ENVVARS + [19759] Don't inline mempcpy for x86 + [19762] Use HAS_ARCH_FEATURE with Fast_Rep_String ++ [19791] Assertion failure in res_query.c with un-connectable name server ++ addresses + [19792] MIPS: backtrace yields infinite backtrace with makecontext + [19822] libm.so install clobbers old version ++ [19879] network: nss_dns: Stack overflow in getnetbyname implementation ++ (CVE-2016-3075) + + Version 2.23 * Unicode 8.0.0 Support: Character encoding, character type info, and -@@ -38,7 +54,7 @@ Version 2.23 +@@ -38,7 +61,7 @@ Version 2.23 unnecessary serialization of memory allocation requests across threads. The defect is now corrected. Users should see a substantial increase in the concurent throughput of allocation requests for applications which @@ -55230,6 +55285,29 @@ #~ msgid "compile-time support for database policy missing" #~ msgstr "compile-time 支援用於資料庫策略缺少" +diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c +index 2eb2f67..8f301a7 100644 +--- a/resolv/nss_dns/dns-network.c ++++ b/resolv/nss_dns/dns-network.c +@@ -118,17 +118,14 @@ _nss_dns_getnetbyname_r (const char *name, struct netent *result, + } net_buffer; + querybuf *orig_net_buffer; + int anslen; +- char *qbuf; + enum nss_status status; + + if (__res_maybe_init (&_res, 0) == -1) + return NSS_STATUS_UNAVAIL; + +- qbuf = strdupa (name); +- + net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); + +- anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, ++ anslen = __libc_res_nsearch (&_res, name, C_IN, T_PTR, net_buffer.buf->buf, + 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); + if (anslen < 0) + { diff --git a/resolv/res_init.c b/resolv/res_init.c index e0b6a80..6c951f5 100644 --- a/resolv/res_init.c @@ -55243,6 +55321,172 @@ if (statp->_u._ext.nsaddrs[ns]) { if (statp->_u._ext.nssocks[ns] != -1) { close_not_cancel_no_status(statp->_u._ext.nssocks[ns]); +diff --git a/resolv/res_send.c b/resolv/res_send.c +index 25c19f1..b4efcb6 100644 +--- a/resolv/res_send.c ++++ b/resolv/res_send.c +@@ -649,6 +649,18 @@ get_nsaddr (res_state statp, int n) + return (struct sockaddr *) (void *) &statp->nsaddr_list[n]; + } + ++/* Close the resolver structure, assign zero to *RESPLEN2 if RESPLEN2 ++ is not NULL, and return zero. */ ++static int ++__attribute__ ((warn_unused_result)) ++close_and_return_error (res_state statp, int *resplen2) ++{ ++ __res_iclose(statp, false); ++ if (resplen2 != NULL) ++ *resplen2 = 0; ++ return 0; ++} ++ + /* The send_vc function is responsible for sending a DNS query over TCP + to the nameserver numbered NS from the res_state STATP i.e. + EXT(statp).nssocks[ns]. The function supports sending both IPv4 and +@@ -1114,7 +1126,11 @@ send_dg(res_state statp, + retry_reopen: + retval = reopen (statp, terrno, ns); + if (retval <= 0) +- return retval; ++ { ++ if (resplen2 != NULL) ++ *resplen2 = 0; ++ return retval; ++ } + retry: + evNowTime(&now); + evConsTime(&timeout, seconds, 0); +@@ -1127,8 +1143,6 @@ send_dg(res_state statp, + int recvresp2 = buf2 == NULL; + pfd[0].fd = EXT(statp).nssocks[ns]; + pfd[0].events = POLLOUT; +- if (resplen2 != NULL) +- *resplen2 = 0; + wait: + if (need_recompute) { + recompute_resend: +@@ -1136,9 +1150,7 @@ send_dg(res_state statp, + if (evCmpTime(finish, now) <= 0) { + poll_err_out: + Perror(statp, stderr, "poll", errno); +- err_out: +- __res_iclose(statp, false); +- return (0); ++ return close_and_return_error (statp, resplen2); + } + evSubTime(&timeout, &finish, &now); + need_recompute = 0; +@@ -1185,7 +1197,9 @@ send_dg(res_state statp, + } + + *gotsomewhere = 1; +- return (0); ++ if (resplen2 != NULL) ++ *resplen2 = 0; ++ return 0; + } + if (n < 0) { + if (errno == EINTR) +@@ -1253,7 +1267,7 @@ send_dg(res_state statp, + + fail_sendmmsg: + Perror(statp, stderr, "sendmmsg", errno); +- goto err_out; ++ return close_and_return_error (statp, resplen2); + } + } + else +@@ -1271,7 +1285,7 @@ send_dg(res_state statp, + if (errno == EINTR || errno == EAGAIN) + goto recompute_resend; + Perror(statp, stderr, "send", errno); +- goto err_out; ++ return close_and_return_error (statp, resplen2); + } + just_one: + if (nwritten != 0 || buf2 == NULL || single_request) +@@ -1349,7 +1363,7 @@ send_dg(res_state statp, + goto wait; + } + Perror(statp, stderr, "recvfrom", errno); +- goto err_out; ++ return close_and_return_error (statp, resplen2); + } + *gotsomewhere = 1; + if (__glibc_unlikely (*thisresplenp < HFIXEDSZ)) { +@@ -1360,7 +1374,7 @@ send_dg(res_state statp, + (stdout, ";; undersized: %d\n", + *thisresplenp)); + *terrno = EMSGSIZE; +- goto err_out; ++ return close_and_return_error (statp, resplen2); + } + if ((recvresp1 || hp->id != anhp->id) + && (recvresp2 || hp2->id != anhp->id)) { +@@ -1409,7 +1423,7 @@ send_dg(res_state statp, + ? *thisanssizp : *thisresplenp); + /* record the error */ + statp->_flags |= RES_F_EDNS0ERR; +- goto err_out; ++ return close_and_return_error (statp, resplen2); + } + #endif + if (!(statp->options & RES_INSECURE2) +@@ -1461,10 +1475,10 @@ send_dg(res_state statp, + goto wait; + } + +- __res_iclose(statp, false); + /* don't retry if called from dig */ + if (!statp->pfcode) +- return (0); ++ return close_and_return_error (statp, resplen2); ++ __res_iclose(statp, false); + } + if (anhp->rcode == NOERROR && anhp->ancount == 0 + && anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) { +@@ -1486,6 +1500,8 @@ send_dg(res_state statp, + __res_iclose(statp, false); + // XXX if we have received one reply we could + // XXX use it and not repeat it over TCP... ++ if (resplen2 != NULL) ++ *resplen2 = 0; + return (1); + } + /* Mark which reply we received. */ +@@ -1501,21 +1517,22 @@ send_dg(res_state statp, + __res_iclose (statp, false); + retval = reopen (statp, terrno, ns); + if (retval <= 0) +- return retval; ++ { ++ if (resplen2 != NULL) ++ *resplen2 = 0; ++ return retval; ++ } + pfd[0].fd = EXT(statp).nssocks[ns]; + } + } + goto wait; + } +- /* +- * All is well, or the error is fatal. Signal that the +- * next nameserver ought not be tried. +- */ ++ /* All is well. We have received both responses (if ++ two responses were requested). */ + return (resplen); +- } else if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) { +- /* Something went wrong. We can stop trying. */ +- goto err_out; +- } ++ } else if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) ++ /* Something went wrong. We can stop trying. */ ++ return close_and_return_error (statp, resplen2); + else { + /* poll should not have returned > 0 in this case. */ + abort (); diff --git a/sysdeps/arm/nacl/libc.abilist b/sysdeps/arm/nacl/libc.abilist index 561441e..0560510 100644 --- a/sysdeps/arm/nacl/libc.abilist @@ -55374,6 +55618,943 @@ jz 2f LOAD_FUNC_GOT_EAX (__memset_chk_sse2_rep) 2: ret +diff --git a/sysdeps/s390/bits/link.h b/sysdeps/s390/bits/link.h +index 2ef7f44..e27ed67 100644 +--- a/sysdeps/s390/bits/link.h ++++ b/sysdeps/s390/bits/link.h +@@ -19,6 +19,9 @@ + # error "Never include directly; use instead." + #endif + ++#if defined HAVE_S390_VX_ASM_SUPPORT ++typedef char La_s390_vr[16]; ++#endif + + #if __ELF_NATIVE_CLASS == 32 + +@@ -32,6 +35,16 @@ typedef struct La_s390_32_regs + uint32_t lr_r6; + double lr_fp0; + double lr_fp2; ++# if defined HAVE_S390_VX_ASM_SUPPORT ++ La_s390_vr lr_v24; ++ La_s390_vr lr_v25; ++ La_s390_vr lr_v26; ++ La_s390_vr lr_v27; ++ La_s390_vr lr_v28; ++ La_s390_vr lr_v29; ++ La_s390_vr lr_v30; ++ La_s390_vr lr_v31; ++# endif + } La_s390_32_regs; + + /* Return values for calls from PLT on s390-32. */ +@@ -40,6 +53,9 @@ typedef struct La_s390_32_retval + uint32_t lrv_r2; + uint32_t lrv_r3; + double lrv_fp0; ++# if defined HAVE_S390_VX_ASM_SUPPORT ++ La_s390_vr lrv_v24; ++# endif + } La_s390_32_retval; + + +@@ -77,6 +93,16 @@ typedef struct La_s390_64_regs + double lr_fp2; + double lr_fp4; + double lr_fp6; ++# if defined HAVE_S390_VX_ASM_SUPPORT ++ La_s390_vr lr_v24; ++ La_s390_vr lr_v25; ++ La_s390_vr lr_v26; ++ La_s390_vr lr_v27; ++ La_s390_vr lr_v28; ++ La_s390_vr lr_v29; ++ La_s390_vr lr_v30; ++ La_s390_vr lr_v31; ++# endif + } La_s390_64_regs; + + /* Return values for calls from PLT on s390-64. */ +@@ -84,6 +110,9 @@ typedef struct La_s390_64_retval + { + uint64_t lrv_r2; + double lrv_fp0; ++# if defined HAVE_S390_VX_ASM_SUPPORT ++ La_s390_vr lrv_v24; ++# endif + } La_s390_64_retval; + + +diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h +index 14bde3b..ec0ae4a 100644 +--- a/sysdeps/s390/s390-32/dl-machine.h ++++ b/sysdeps/s390/s390-32/dl-machine.h +@@ -89,6 +89,11 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) + { + extern void _dl_runtime_resolve (Elf32_Word); + extern void _dl_runtime_profile (Elf32_Word); ++#if defined HAVE_S390_VX_ASM_SUPPORT ++ extern void _dl_runtime_resolve_vx (Elf32_Word); ++ extern void _dl_runtime_profile_vx (Elf32_Word); ++#endif ++ + + if (l->l_info[DT_JMPREL] && lazy) + { +@@ -116,7 +121,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) + end in this function. */ + if (__glibc_unlikely (profile)) + { ++#if defined HAVE_S390_VX_ASM_SUPPORT ++ if (GLRO(dl_hwcap) & HWCAP_S390_VX) ++ got[2] = (Elf32_Addr) &_dl_runtime_profile_vx; ++ else ++ got[2] = (Elf32_Addr) &_dl_runtime_profile; ++#else + got[2] = (Elf32_Addr) &_dl_runtime_profile; ++#endif + + if (GLRO(dl_profile) != NULL + && _dl_name_match_p (GLRO(dl_profile), l)) +@@ -125,9 +137,18 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) + GL(dl_profile_map) = l; + } + else +- /* This function will get called to fix up the GOT entry indicated by +- the offset on the stack, and then jump to the resolved address. */ +- got[2] = (Elf32_Addr) &_dl_runtime_resolve; ++ { ++ /* This function will get called to fix up the GOT entry indicated by ++ the offset on the stack, and then jump to the resolved address. */ ++#if defined HAVE_S390_VX_ASM_SUPPORT ++ if (GLRO(dl_hwcap) & HWCAP_S390_VX) ++ got[2] = (Elf32_Addr) &_dl_runtime_resolve_vx; ++ else ++ got[2] = (Elf32_Addr) &_dl_runtime_resolve; ++#else ++ got[2] = (Elf32_Addr) &_dl_runtime_resolve; ++#endif ++ } + } + + return lazy; +diff --git a/sysdeps/s390/s390-32/dl-trampoline.S b/sysdeps/s390/s390-32/dl-trampoline.S +index 1645610..859183c 100644 +--- a/sysdeps/s390/s390-32/dl-trampoline.S ++++ b/sysdeps/s390/s390-32/dl-trampoline.S +@@ -16,130 +16,18 @@ + License along with the GNU C Library; if not, see + . */ + +-/* This code is used in dl-runtime.c to call the `fixup' function +- and then redirect to the address it returns. */ +- +-/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile +- * with the following linkage: +- * r2 - r6 : parameter registers +- * f0, f2 : floating point parameter registers +- * 24(r15), 28(r15) : PLT arguments PLT1, PLT2 +- * 96(r15) : additional stack parameters +- * The normal clobber rules for function calls apply: +- * r0 - r5 : call clobbered +- * r6 - r13 : call saved +- * r14 : return address (call clobbered) +- * r15 : stack pointer (call saved) +- * f4, f6 : call saved +- * f0 - f3, f5, f7 - f15 : call clobbered +- */ +- + #include + + .text +- .globl _dl_runtime_resolve +- .type _dl_runtime_resolve, @function +- cfi_startproc +- .align 16 +-_dl_runtime_resolve: +- stm %r2,%r5,32(%r15) # save registers +- st %r14,8(%r15) +- cfi_offset (r14, -88) +- lr %r0,%r15 # create stack frame +- ahi %r15,-96 +- cfi_adjust_cfa_offset (96) +- st 0,0(%r15) +- lm %r2,%r3,120(%r15) # load args saved by PLT +- basr %r1,0 +-0: l %r14,1f-0b(%r1) +- bas %r14,0(%r14,%r1) # call resolver +- lr %r1,%r2 # function addr returned in r2 +- ahi %r15,96 # remove stack frame +- cfi_adjust_cfa_offset (-96) +- l %r14,8(15) # restore registers +- lm %r2,%r5,32(%r15) +- br %r1 +-1: .long _dl_fixup - 0b +- cfi_endproc +- .size _dl_runtime_resolve, .-_dl_runtime_resolve +- +- +-#ifndef PROF +- .globl _dl_runtime_profile +- .type _dl_runtime_profile, @function +- cfi_startproc +- .align 16 +-_dl_runtime_profile: +- stm %r2,%r6,32(%r15) # save registers +- std %f0,56(%r15) +- std %f2,64(%r15) +- st %r6,8(%r15) +- st %r12,12(%r15) +- st %r14,16(%r15) +- cfi_offset (r6, -64) +- cfi_offset (f0, -40) +- cfi_offset (f2, -32) +- cfi_offset (r12, -84) +- cfi_offset (r14, -80) +- lr %r12,%r15 # create stack frame +- cfi_def_cfa_register (12) +- ahi %r15,-96 +- st %r12,0(%r15) +- lm %r2,%r3,24(%r12) # load arguments saved by PLT +- lr %r4,%r14 # return address as third parameter +- basr %r1,0 +-0: l %r14,6f-0b(%r1) +- la %r5,32(%r12) # pointer to struct La_s390_32_regs +- la %r6,20(%r12) # long int * framesize +- bas %r14,0(%r14,%r1) # call resolver +- lr %r1,%r2 # function addr returned in r2 +- icm %r0,15,20(%r12) # load & test framesize +- jnm 2f +- +- lm %r2,%r6,32(%r12) +- ld %f0,56(%r12) +- ld %f2,64(%r12) +- lr %r15,%r12 # remove stack frame +- cfi_def_cfa_register (15) +- l %r14,16(%r15) # restore registers +- l %r12,12(%r15) +- br %r1 # tail-call to the resolved function +- +- cfi_def_cfa_register (12) +-2: jz 4f # framesize == 0 ? +- ahi %r0,7 # align framesize to 8 +- lhi %r2,-8 +- nr %r0,%r2 +- slr %r15,%r0 # make room for framesize bytes +- st %r12,0(%r15) +- la %r2,96(%r15) +- la %r3,96(%r12) +- srl %r0,3 +-3: mvc 0(8,%r2),0(%r3) # copy additional parameters +- la %r2,8(%r2) +- la %r3,8(%r3) +- brct %r0,3b +-4: lm %r2,%r6,32(%r12) # load register parameters +- ld %f0,56(%r12) +- ld %f2,64(%r12) +- basr %r14,%r1 # call resolved function +- stm %r2,%r3,72(%r12) +- std %f0,80(%r12) +- lm %r2,%r3,24(%r12) # load arguments saved by PLT +- basr %r1,0 +-5: l %r14,7f-5b(%r1) +- la %r4,32(%r12) # pointer to struct La_s390_32_regs +- la %r5,72(%r12) # pointer to struct La_s390_32_retval +- basr %r14,%r1 # call _dl_call_pltexit +- +- lr %r15,%r12 # remove stack frame +- cfi_def_cfa_register (15) +- l %r14,16(%r15) # restore registers +- l %r12,12(%r15) +- br %r14 +- +-6: .long _dl_profile_fixup - 0b +-7: .long _dl_call_pltexit - 5b +- cfi_endproc +- .size _dl_runtime_profile, .-_dl_runtime_profile ++/* Create variant of _dl_runtime_resolve/profile for machines before z13. ++ No vector registers are saved/restored. */ ++#include ++ ++#if defined HAVE_S390_VX_ASM_SUPPORT ++/* Create variant of _dl_runtime_resolve/profile for z13 and newer. ++ The vector registers are saved/restored, too.*/ ++# define _dl_runtime_resolve _dl_runtime_resolve_vx ++# define _dl_runtime_profile _dl_runtime_profile_vx ++# define RESTORE_VRS ++# include + #endif +diff --git a/sysdeps/s390/s390-32/dl-trampoline.h b/sysdeps/s390/s390-32/dl-trampoline.h +new file mode 100644 +index 0000000..086449f +--- /dev/null ++++ b/sysdeps/s390/s390-32/dl-trampoline.h +@@ -0,0 +1,231 @@ ++/* PLT trampolines. s390 version. ++ Copyright (C) 2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++/* This code is used in dl-runtime.c to call the `fixup' function ++ and then redirect to the address it returns. */ ++ ++/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile ++ * with the following linkage: ++ * r2 - r6 : parameter registers ++ * f0, f2 : floating point parameter registers ++ * v24, v26, v28, v30, v25, v27, v29, v31 : vector parameter registers ++ * 24(r15), 28(r15) : PLT arguments PLT1, PLT2 ++ * 96(r15) : additional stack parameters ++ * The normal clobber rules for function calls apply: ++ * r0 - r5 : call clobbered ++ * r6 - r13 : call saved ++ * r14 : return address (call clobbered) ++ * r15 : stack pointer (call saved) ++ * f4, f6 : call saved ++ * f0 - f3, f5, f7 - f15 : call clobbered ++ * v0 - v3, v5, v7 - v15 : bytes 0-7 overlap with fprs: call clobbered ++ bytes 8-15: call clobbered ++ * v4, v6 : bytes 0-7 overlap with f4, f6: call saved ++ bytes 8-15: call clobbered ++ * v16 - v31 : call clobbered ++ */ ++ ++ ++ .globl _dl_runtime_resolve ++ .type _dl_runtime_resolve, @function ++ cfi_startproc ++ .align 16 ++_dl_runtime_resolve: ++ stm %r2,%r5,32(%r15) # save registers ++ cfi_offset (r2, -64) ++ cfi_offset (r3, -60) ++ cfi_offset (r4, -56) ++ cfi_offset (r5, -52) ++ std %f0,56(%r15) ++ cfi_offset (f0, -40) ++ std %f2,64(%r15) ++ cfi_offset (f2, -32) ++ st %r14,8(%r15) ++ cfi_offset (r14, -88) ++ lr %r0,%r15 ++ lm %r2,%r3,24(%r15) # load args saved by PLT ++#ifdef RESTORE_VRS ++ ahi %r15,-224 # create stack frame ++ cfi_adjust_cfa_offset (224) ++ .machine push ++ .machine "z13" ++ .machinemode "zarch_nohighgprs" ++ vstm %v24,%v31,96(%r15) # store call-clobbered vr arguments ++ cfi_offset (v24, -224) ++ cfi_offset (v25, -208) ++ cfi_offset (v26, -192) ++ cfi_offset (v27, -176) ++ cfi_offset (v28, -160) ++ cfi_offset (v29, -144) ++ cfi_offset (v30, -128) ++ cfi_offset (v31, -112) ++ .machine pop ++#else ++ ahi %r15,-96 # create stack frame ++ cfi_adjust_cfa_offset (96) ++#endif ++ st %r0,0(%r15) # write backchain ++ basr %r1,0 ++0: l %r14,1f-0b(%r1) ++ bas %r14,0(%r14,%r1) # call _dl_fixup ++ lr %r1,%r2 # function addr returned in r2 ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ .machinemode "zarch_nohighgprs" ++ vlm %v24,%v31,96(%r15) # restore vector registers ++ .machine pop ++ ahi %r15,224 # remove stack frame ++ cfi_adjust_cfa_offset (-224) ++#else ++ ahi %r15,96 # remove stack frame ++ cfi_adjust_cfa_offset (-96) ++#endif ++ l %r14,8(15) # restore registers ++ ld %f0,56(%r15) ++ ld %f2,64(%r15) ++ lm %r2,%r5,32(%r15) ++ br %r1 ++1: .long _dl_fixup - 0b ++ cfi_endproc ++ .size _dl_runtime_resolve, .-_dl_runtime_resolve ++ ++ ++#ifndef PROF ++ .globl _dl_runtime_profile ++ .type _dl_runtime_profile, @function ++ cfi_startproc ++ .align 16 ++_dl_runtime_profile: ++ st %r12,12(%r15) # r12 is used as backup of r15 ++ cfi_offset (r12, -84) ++ st %r14,16(%r15) ++ cfi_offset (r14, -80) ++ lr %r12,%r15 # backup stack pointer ++ cfi_def_cfa_register (12) ++ ahi %r15,-264 # create stack frame: ++ # 96 + sizeof(La_s390_32_regs) ++ st %r12,0(%r15) # save backchain ++ ++ stm %r2,%r6,96(%r15) # save registers ++ cfi_offset (r2, -264) # + r6 needed as arg for ++ cfi_offset (r3, -260) # _dl_profile_fixup ++ cfi_offset (r4, -256) ++ cfi_offset (r5, -252) ++ cfi_offset (r6, -248) ++ std %f0,120(%r15) ++ cfi_offset (f0, -240) ++ std %f2,128(%r15) ++ cfi_offset (f2, -232) ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ .machinemode "zarch_nohighgprs" ++ vstm %v24,%v31,136(%r15) # store call-clobbered vr arguments ++ cfi_offset (v24, -224) ++ cfi_offset (v25, -208) ++ cfi_offset (v26, -192) ++ cfi_offset (v27, -176) ++ cfi_offset (v28, -160) ++ cfi_offset (v29, -144) ++ cfi_offset (v30, -128) ++ cfi_offset (v31, -112) ++ .machine pop ++#endif ++ ++ lm %r2,%r3,24(%r12) # load arguments saved by PLT ++ lr %r4,%r14 # return address as third parameter ++ basr %r1,0 ++0: l %r14,6f-0b(%r1) ++ la %r5,96(%r15) # pointer to struct La_s390_32_regs ++ la %r6,20(%r12) # long int * framesize ++ bas %r14,0(%r14,%r1) # call resolver ++ lr %r1,%r2 # function addr returned in r2 ++ ld %f0,120(%r15) # restore call-clobbered arg fprs ++ ld %f2,128(%r15) ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ .machinemode "zarch_nohighgprs" ++ vlm %v24,%v31,136(%r15) # restore call-clobbered arg vrs ++ .machine pop ++#endif ++ icm %r0,15,20(%r12) # load & test framesize ++ jnm 2f ++ ++ lm %r2,%r6,96(%r15) # framesize < 0 means no pltexit call ++ # so we can do a tail call without ++ # copying the arg overflow area ++ lr %r15,%r12 # remove stack frame ++ cfi_def_cfa_register (15) ++ l %r14,16(%r15) # restore registers ++ l %r12,12(%r15) ++ br %r1 # tail-call to the resolved function ++ ++ cfi_def_cfa_register (12) ++2: la %r4,96(%r15) # pointer to struct La_s390_32_regs ++ st %r4,32(%r12) ++ jz 4f # framesize == 0 ? ++ ahi %r0,7 # align framesize to 8 ++ lhi %r2,-8 ++ nr %r0,%r2 ++ slr %r15,%r0 # make room for framesize bytes ++ st %r12,0(%r15) # save backchain ++ la %r2,96(%r15) ++ la %r3,96(%r12) ++ srl %r0,3 ++3: mvc 0(8,%r2),0(%r3) # copy additional parameters ++ la %r2,8(%r2) ++ la %r3,8(%r3) ++ brct %r0,3b ++4: lm %r2,%r6,0(%r4) # load register parameters ++ basr %r14,%r1 # call resolved function ++ stm %r2,%r3,40(%r12) # store return values r2, r3, f0 ++ std %f0,48(%r12) # to struct La_s390_32_retval ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ vst %v24,56(%r12) # store return value v24 ++ .machine pop ++#endif ++ lm %r2,%r4,24(%r12) # r2, r3: load arguments saved by PLT ++ # r4: pointer to struct La_s390_32_regs ++ basr %r1,0 ++5: l %r14,7f-5b(%r1) ++ la %r5,40(%r12) # pointer to struct La_s390_32_retval ++ bas %r14,0(%r14,%r1) # call _dl_call_pltexit ++ ++ lr %r15,%r12 # remove stack frame ++ cfi_def_cfa_register (15) ++ l %r14,16(%r15) # restore registers ++ l %r12,12(%r15) ++ lm %r2,%r3,40(%r15) # restore return values ++ ld %f0,48(%r15) ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ vl %v24,56(%r15) # restore return value v24 ++ .machine pop ++#endif ++ br %r14 ++ ++6: .long _dl_profile_fixup - 0b ++7: .long _dl_call_pltexit - 5b ++ cfi_endproc ++ .size _dl_runtime_profile, .-_dl_runtime_profile ++#endif +diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h +index cb81aaf..9ee7c92 100644 +--- a/sysdeps/s390/s390-64/dl-machine.h ++++ b/sysdeps/s390/s390-64/dl-machine.h +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + + #define ELF_MACHINE_IRELATIVE R_390_IRELATIVE +@@ -78,6 +79,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) + { + extern void _dl_runtime_resolve (Elf64_Word); + extern void _dl_runtime_profile (Elf64_Word); ++#if defined HAVE_S390_VX_ASM_SUPPORT ++ extern void _dl_runtime_resolve_vx (Elf64_Word); ++ extern void _dl_runtime_profile_vx (Elf64_Word); ++#endif + + if (l->l_info[DT_JMPREL] && lazy) + { +@@ -105,7 +110,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) + end in this function. */ + if (__glibc_unlikely (profile)) + { ++#if defined HAVE_S390_VX_ASM_SUPPORT ++ if (GLRO(dl_hwcap) & HWCAP_S390_VX) ++ got[2] = (Elf64_Addr) &_dl_runtime_profile_vx; ++ else ++ got[2] = (Elf64_Addr) &_dl_runtime_profile; ++#else + got[2] = (Elf64_Addr) &_dl_runtime_profile; ++#endif + + if (GLRO(dl_profile) != NULL + && _dl_name_match_p (GLRO(dl_profile), l)) +@@ -114,9 +126,18 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) + GL(dl_profile_map) = l; + } + else +- /* This function will get called to fix up the GOT entry indicated by +- the offset on the stack, and then jump to the resolved address. */ +- got[2] = (Elf64_Addr) &_dl_runtime_resolve; ++ { ++ /* This function will get called to fix up the GOT entry indicated by ++ the offset on the stack, and then jump to the resolved address. */ ++#if defined HAVE_S390_VX_ASM_SUPPORT ++ if (GLRO(dl_hwcap) & HWCAP_S390_VX) ++ got[2] = (Elf64_Addr) &_dl_runtime_resolve_vx; ++ else ++ got[2] = (Elf64_Addr) &_dl_runtime_resolve; ++#else ++ got[2] = (Elf64_Addr) &_dl_runtime_resolve; ++#endif ++ } + } + + return lazy; +diff --git a/sysdeps/s390/s390-64/dl-trampoline.S b/sysdeps/s390/s390-64/dl-trampoline.S +index 6919ed0..1b0c9e2 100644 +--- a/sysdeps/s390/s390-64/dl-trampoline.S ++++ b/sysdeps/s390/s390-64/dl-trampoline.S +@@ -16,126 +16,18 @@ + License along with the GNU C Library; if not, see + . */ + +-/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile +- * with the following linkage: +- * r2 - r6 : parameter registers +- * f0, f2, f4, f6 : floating point parameter registers +- * 48(r15), 56(r15) : PLT arguments PLT1, PLT2 +- * 160(r15) : additional stack parameters +- * The normal clobber rules for function calls apply: +- * r0 - r5 : call clobbered +- * r6 - r13 : call saved +- * r14 : return address (call clobbered) +- * r15 : stack pointer (call saved) +- * f1, f3, f5, f7 : call saved +- * f0 - f3, f5, f7 - f15 : call clobbered +- */ +- + #include + + .text +- .globl _dl_runtime_resolve +- .type _dl_runtime_resolve, @function +- cfi_startproc +- .align 16 +-_dl_runtime_resolve: +- stmg %r2,%r5,64(15) # save call-clobbered argument registers +- stg %r14,96(15) +- cfi_offset (r14, -64) +- lgr %r0,%r15 +- aghi %r15,-160 # create stack frame +- cfi_adjust_cfa_offset (160) +- stg %r0,0(%r15) # write backchain +- lmg %r2,%r3,208(%r15)# load args saved by PLT +- brasl %r14,_dl_fixup # call fixup +- lgr %r1,%r2 # function addr returned in r2 +- aghi %r15,160 # remove stack frame +- cfi_adjust_cfa_offset (-160) +- lg %r14,96(15) # restore registers +- lmg %r2,%r5,64(15) +- br %r1 +- cfi_endproc +- .size _dl_runtime_resolve, .-_dl_runtime_resolve +- +- +-#ifndef PROF +- .globl _dl_runtime_profile +- .type _dl_runtime_profile, @function +- cfi_startproc +- .align 16 +-_dl_runtime_profile: +- stmg %r2,%r6,64(%r15) # save call-clobbered arg regs +- std %f0,104(%r15) # + r6 needed as arg for +- std %f2,112(%r15) # _dl_profile_fixup +- std %f4,120(%r15) +- std %f6,128(%r15) +- stg %r12,24(%r15) # r12 is used as backup of r15 +- stg %r14,32(%r15) +- cfi_offset (r6, -96) +- cfi_offset (f0, -56) +- cfi_offset (f2, -48) +- cfi_offset (f4, -40) +- cfi_offset (f6, -32) +- cfi_offset (r12, -136) +- cfi_offset (r14, -128) +- lgr %r12,%r15 # backup stack pointer +- cfi_def_cfa_register (12) +- aghi %r15,-160 # create stack frame +- stg %r12,0(%r15) # save backchain +- lmg %r2,%r3,48(%r12) # load arguments saved by PLT +- lgr %r4,%r14 # return address as third parameter +- la %r5,64(%r12) # pointer to struct La_s390_32_regs +- la %r6,40(%r12) # long int * framesize +- brasl %r14,_dl_profile_fixup # call resolver +- lgr %r1,%r2 # function addr returned in r2 +- lg %r0,40(%r12) # load framesize +- ltgr %r0,%r0 +- jnm 1f +- +- lmg %r2,%r6,64(%r12) # framesize < 0 means no pltexit call +- ld %f0,104(%r12) # so we can do a tail call without +- ld %f2,112(%r12) # copying the arg overflow area +- ld %f4,120(%r12) +- ld %f6,128(%r12) +- +- lgr %r15,%r12 # remove stack frame +- cfi_def_cfa_register (15) +- lg %r14,32(%r15) # restore registers +- lg %r12,24(%r15) +- br %r1 # tail-call to resolved function +- +- cfi_def_cfa_register (12) +-1: jz 4f # framesize == 0 ? +- aghi %r0,7 # align framesize to 8 +- nill %r0,0xfff8 +- slgr %r15,%r0 # make room for framesize bytes +- stg %r12,0(%r15) +- la %r2,160(%r15) +- la %r3,160(%r12) +- srlg %r0,%r0,3 +-3: mvc 0(8,%r2),0(%r3) # copy additional parameters +- la %r2,8(%r2) +- la %r3,8(%r3) +- brctg %r0,3b +-4: lmg %r2,%r6,64(%r12) # load register parameters +- ld %f0,104(%r12) # restore call-clobbered arg regs +- ld %f2,112(%r12) +- ld %f4,120(%r12) +- ld %f6,128(%r12) +- basr %r14,%r1 # call resolved function +- stg %r2,136(%r12) +- std %f0,144(%r12) +- lmg %r2,%r3,48(%r12) # load arguments saved by PLT +- la %r4,32(%r12) # pointer to struct La_s390_32_regs +- la %r5,72(%r12) # pointer to struct La_s390_32_retval +- brasl %r14,_dl_call_pltexit +- +- lgr %r15,%r12 # remove stack frame +- cfi_def_cfa_register (15) +- lg %r14,32(%r15) # restore registers +- lg %r12,24(%r15) +- br %r14 +- +- cfi_endproc +- .size _dl_runtime_profile, .-_dl_runtime_profile ++/* Create variant of _dl_runtime_resolve/profile for machines before z13. ++ No vector registers are saved/restored. */ ++#include ++ ++#if defined HAVE_S390_VX_ASM_SUPPORT ++/* Create variant of _dl_runtime_resolve/profile for z13 and newer. ++ The vector registers are saved/restored, too.*/ ++# define _dl_runtime_resolve _dl_runtime_resolve_vx ++# define _dl_runtime_profile _dl_runtime_profile_vx ++# define RESTORE_VRS ++# include + #endif +diff --git a/sysdeps/s390/s390-64/dl-trampoline.h b/sysdeps/s390/s390-64/dl-trampoline.h +new file mode 100644 +index 0000000..33ea3de +--- /dev/null ++++ b/sysdeps/s390/s390-64/dl-trampoline.h +@@ -0,0 +1,225 @@ ++/* PLT trampolines. s390x version. ++ Copyright (C) 2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++/* The PLT stubs will call _dl_runtime_resolve/_dl_runtime_profile ++ * with the following linkage: ++ * r2 - r6 : parameter registers ++ * f0, f2, f4, f6 : floating point parameter registers ++ * v24, v26, v28, v30, v25, v27, v29, v31 : vector parameter registers ++ * 48(r15), 56(r15) : PLT arguments PLT1, PLT2 ++ * 160(r15) : additional stack parameters ++ * The normal clobber rules for function calls apply: ++ * r0 - r5 : call clobbered ++ * r6 - r13 : call saved ++ * r14 : return address (call clobbered) ++ * r15 : stack pointer (call saved) ++ * f0 - f7 : call clobbered ++ * f8 - f15 : call saved ++ * v0 - v7 : bytes 0-7 overlap with f0-f7: call clobbered ++ bytes 8-15: call clobbered ++ * v8 - v15 : bytes 0-7 overlap with f8-f15: call saved ++ bytes 8-15: call clobbered ++ * v16 - v31 : call clobbered ++ */ ++ ++ .globl _dl_runtime_resolve ++ .type _dl_runtime_resolve, @function ++ cfi_startproc ++ .align 16 ++_dl_runtime_resolve: ++ stmg %r2,%r5,64(%r15) # save call-clobbered argument registers ++ cfi_offset (r2, -96) ++ cfi_offset (r3, -88) ++ cfi_offset (r4, -80) ++ cfi_offset (r5, -72) ++ std %f0,104(%r15) ++ cfi_offset (f0, -56) ++ std %f2,112(%r15) ++ cfi_offset (f2, -48) ++ std %f4,120(%r15) ++ cfi_offset (f4, -40) ++ std %f6,128(%r15) ++ cfi_offset (f6, -32) ++ stg %r14,96(15) ++ cfi_offset (r14, -64) ++ lmg %r2,%r3,48(%r15) # load args for fixup saved by PLT ++ lgr %r0,%r15 ++#ifdef RESTORE_VRS ++ aghi %r15,-288 # create stack frame ++ cfi_adjust_cfa_offset (288) ++ .machine push ++ .machine "z13" ++ vstm %v24,%v31,160(%r15)# store call-clobbered vector argument registers ++ cfi_offset (v24, -288) ++ cfi_offset (v25, -272) ++ cfi_offset (v26, -256) ++ cfi_offset (v27, -240) ++ cfi_offset (v28, -224) ++ cfi_offset (v29, -208) ++ cfi_offset (v30, -192) ++ cfi_offset (v31, -176) ++ .machine pop ++#else ++ aghi %r15,-160 # create stack frame ++ cfi_adjust_cfa_offset (160) ++#endif ++ stg %r0,0(%r15) # write backchain ++ brasl %r14,_dl_fixup # call _dl_fixup ++ lgr %r1,%r2 # function addr returned in r2 ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ vlm %v24,%v31,160(%r15)# restore vector registers ++ .machine pop ++ aghi %r15,288 # remove stack frame ++ cfi_adjust_cfa_offset (-288) ++#else ++ aghi %r15,160 # remove stack frame ++ cfi_adjust_cfa_offset (-160) ++#endif ++ lg %r14,96(%r15) # restore registers ++ ld %f0,104(%r15) ++ ld %f2,112(%r15) ++ ld %f4,120(%r15) ++ ld %f6,128(%r15) ++ lmg %r2,%r5,64(%r15) ++ br %r1 ++ cfi_endproc ++ .size _dl_runtime_resolve, .-_dl_runtime_resolve ++ ++ ++#ifndef PROF ++ .globl _dl_runtime_profile ++ .type _dl_runtime_profile, @function ++ cfi_startproc ++ .align 16 ++_dl_runtime_profile: ++ stg %r12,24(%r15) # r12 is used as backup of r15 ++ cfi_offset (r12, -136) ++ stg %r14,32(%r15) ++ cfi_offset (r14, -128) ++ lgr %r12,%r15 # backup stack pointer ++ cfi_def_cfa_register (12) ++ aghi %r15,-360 # create stack frame: ++ # 160 + sizeof(La_s390_64_regs) ++ stg %r12,0(%r15) # save backchain ++ ++ stmg %r2,%r6,160(%r15) # save call-clobbered arg regs ++ cfi_offset (r2, -360) # + r6 needed as arg for ++ cfi_offset (r3, -352) # _dl_profile_fixup ++ cfi_offset (r4, -344) ++ cfi_offset (r5, -336) ++ cfi_offset (r6, -328) ++ std %f0,200(%r15) ++ cfi_offset (f0, -320) ++ std %f2,208(%r15) ++ cfi_offset (f2, -312) ++ std %f4,216(%r15) ++ cfi_offset (f4, -304) ++ std %f6,224(%r15) ++ cfi_offset (f6, -296) ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ vstm %v24,%v31,232(%r15) # store call-clobbered vector arguments ++ cfi_offset (v24, -288) ++ cfi_offset (v25, -272) ++ cfi_offset (v26, -256) ++ cfi_offset (v27, -240) ++ cfi_offset (v28, -224) ++ cfi_offset (v29, -208) ++ cfi_offset (v30, -192) ++ cfi_offset (v31, -176) ++ .machine pop ++#endif ++ lmg %r2,%r3,48(%r12) # load arguments saved by PLT ++ lgr %r4,%r14 # return address as third parameter ++ la %r5,160(%r15) # pointer to struct La_s390_64_regs ++ la %r6,40(%r12) # long int * framesize ++ brasl %r14,_dl_profile_fixup # call resolver ++ lgr %r1,%r2 # function addr returned in r2 ++ ld %f0,200(%r15) # restore call-clobbered arg fprs ++ ld %f2,208(%r15) ++ ld %f4,216(%r15) ++ ld %f6,224(%r15) ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ vlm %v24,%v31,232(%r15) # restore call-clobbered arg vrs ++ .machine pop ++#endif ++ lg %r0,40(%r12) # load framesize ++ ltgr %r0,%r0 ++ jnm 1f ++ ++ lmg %r2,%r6,160(%r15) # framesize < 0 means no pltexit call ++ # so we can do a tail call without ++ # copying the arg overflow area ++ lgr %r15,%r12 # remove stack frame ++ cfi_def_cfa_register (15) ++ lg %r14,32(%r15) # restore registers ++ lg %r12,24(%r15) ++ br %r1 # tail-call to resolved function ++ ++ cfi_def_cfa_register (12) ++1: la %r4,160(%r15) # pointer to struct La_s390_64_regs ++ stg %r4,64(%r12) ++ jz 4f # framesize == 0 ? ++ aghi %r0,7 # align framesize to 8 ++ nill %r0,0xfff8 ++ slgr %r15,%r0 # make room for framesize bytes ++ stg %r12,0(%r15) # save backchain ++ la %r2,160(%r15) ++ la %r3,160(%r12) ++ srlg %r0,%r0,3 ++3: mvc 0(8,%r2),0(%r3) # copy additional parameters ++ la %r2,8(%r2) # depending on framesize ++ la %r3,8(%r3) ++ brctg %r0,3b ++4: lmg %r2,%r6,0(%r4) # restore call-clobbered arg gprs ++ basr %r14,%r1 # call resolved function ++ stg %r2,72(%r12) # store return values r2, f0 ++ std %f0,80(%r12) # to struct La_s390_64_retval ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ vst %v24,88(%r12) # store return value v24 ++ .machine pop ++#endif ++ lmg %r2,%r4,48(%r12) # r2, r3: load arguments saved by PLT ++ # r4: pointer to struct La_s390_64_regs ++ la %r5,72(%r12) # pointer to struct La_s390_64_retval ++ brasl %r14,_dl_call_pltexit ++ ++ lgr %r15,%r12 # remove stack frame ++ cfi_def_cfa_register (15) ++ lg %r14,32(%r15) # restore registers ++ lg %r12,24(%r15) ++ lg %r2,72(%r15) # restore return values ++ ld %f0,80(%r15) ++#ifdef RESTORE_VRS ++ .machine push ++ .machine "z13" ++ vl %v24,88(%r15) # restore return value v24 ++ .machine pop ++#endif ++ br %r14 # Jump back to caller ++ ++ cfi_endproc ++ .size _dl_runtime_profile, .-_dl_runtime_profile ++#endif diff --git a/sysdeps/unix/sysv/linux/mips/makecontext.S b/sysdeps/unix/sysv/linux/mips/makecontext.S index 66600c7..3196554 100644 --- a/sysdeps/unix/sysv/linux/mips/makecontext.S diff -Nru glibc-2.23/debian/patches/hurd-i386/submitted-anon-mmap-shared.diff glibc-2.23/debian/patches/hurd-i386/submitted-anon-mmap-shared.diff --- glibc-2.23/debian/patches/hurd-i386/submitted-anon-mmap-shared.diff 1970-01-01 00:00:00.000000000 +0000 +++ glibc-2.23/debian/patches/hurd-i386/submitted-anon-mmap-shared.diff 2016-04-14 16:23:01.000000000 +0000 @@ -0,0 +1,36 @@ +Optimizing anonymous maps brings bugs, and does not optimize much anyway. + +https://sourceware.org/bugzilla/show_bug.cgi?id=19903 + +--- a/sysdeps/mach/hurd/mmap.c ++++ b/sysdeps/mach/hurd/mmap.c +@@ -44,29 +44,6 @@ __mmap (__ptr_t addr, size_t len, int pr + if ((mapaddr & (__vm_page_size - 1)) || (offset & (__vm_page_size - 1))) + return (__ptr_t) (long int) __hurd_fail (EINVAL); + +- if ((flags & (MAP_TYPE|MAP_INHERIT)) == MAP_ANON +- && prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */ +- { +- /* vm_allocate has (a little) less overhead in the kernel too. */ +- err = __vm_allocate (__mach_task_self (), &mapaddr, len, mapaddr == 0); +- +- if (err == KERN_NO_SPACE) +- { +- if (flags & MAP_FIXED) +- { +- /* XXX this is not atomic as it is in unix! */ +- /* The region is already allocated; deallocate it first. */ +- err = __vm_deallocate (__mach_task_self (), mapaddr, len); +- if (!err) +- err = __vm_allocate (__mach_task_self (), &mapaddr, len, 0); +- } +- else if (mapaddr != 0) +- err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1); +- } +- +- return err ? (__ptr_t) (long int) __hurd_fail (err) : (__ptr_t) mapaddr; +- } +- + vmprot = VM_PROT_NONE; + if (prot & PROT_READ) + vmprot |= VM_PROT_READ; diff -Nru glibc-2.23/debian/patches/hurd-i386/submitted-auxv.diff glibc-2.23/debian/patches/hurd-i386/submitted-auxv.diff --- glibc-2.23/debian/patches/hurd-i386/submitted-auxv.diff 1970-01-01 00:00:00.000000000 +0000 +++ glibc-2.23/debian/patches/hurd-i386/submitted-auxv.diff 2016-04-14 16:23:01.000000000 +0000 @@ -0,0 +1,14 @@ +https://sourceware.org/ml/libc-alpha/2016-04/msg00025.html + +Index: glibc-2.22/misc/getauxval.c +=================================================================== +--- glibc-2.22.orig/misc/getauxval.c ++++ glibc-2.22/misc/getauxval.c +@@ -35,6 +35,7 @@ __getauxval (unsigned long int type) + else if (type == AT_HWCAP2) + return GLRO(dl_hwcap2); + ++ if (GLRO(dl_auxv)) + for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++) + if (p->a_type == type) + return p->a_un.a_val; diff -Nru glibc-2.23/debian/patches/kfreebsd/local-sysdeps.diff glibc-2.23/debian/patches/kfreebsd/local-sysdeps.diff --- glibc-2.23/debian/patches/kfreebsd/local-sysdeps.diff 2016-03-22 21:03:52.000000000 +0000 +++ glibc-2.23/debian/patches/kfreebsd/local-sysdeps.diff 2016-04-14 16:23:01.000000000 +0000 @@ -5852,7 +5852,7 @@ + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/lib64'; + # Locale data can be shared between 32bit and 64bit libraries -+ libc_cv_localedir='${exec_prefix}/lib/locale' ++ libc_cv_complocaledir='${exec_prefix}/lib/locale' + fi + ;; + mips/mips64/n32/* ) @@ -5860,7 +5860,7 @@ + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/lib32'; + # Locale data can be shared between 32bit and 64bit libraries -+ libc_cv_localedir='${exec_prefix}/lib/locale' ++ libc_cv_complocaledir='${exec_prefix}/lib/locale' + fi + ;; + *) @@ -32613,6 +32613,18 @@ + +#include "../vfork.S" --- /dev/null ++++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fts.c +@@ -0,0 +1,3 @@ ++/* On GNU/kFreeBSD x86_64, ino_t and ino64_t have different sizes, so ++ fts and fts64 have to be different functions. */ ++#include +--- /dev/null ++++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fts64.c +@@ -0,0 +1,3 @@ ++/* On GNU/kFreeBSD x86_64, ino_t and ino64_t have different sizes, so ++ fts and fts64 have to be different functions. */ ++#include +--- /dev/null +++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/get_clockfreq.c @@ -0,0 +1 @@ +#include "../i386/get_clockfreq.c" diff -Nru glibc-2.23/debian/patches/kfreebsd/submitted-auxv.diff glibc-2.23/debian/patches/kfreebsd/submitted-auxv.diff --- glibc-2.23/debian/patches/kfreebsd/submitted-auxv.diff 2016-01-27 14:17:05.000000000 +0000 +++ glibc-2.23/debian/patches/kfreebsd/submitted-auxv.diff 2016-04-14 16:23:01.000000000 +0000 @@ -17,9 +17,9 @@ return GLRO(dl_hwcap2); +#endif + if (GLRO(dl_auxv)) for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++) if (p->a_type == type) - diff --git a/bits/auxv.h b/bits/auxv.h new file mode 100644 index 0000000..76701c3 diff -Nru glibc-2.23/debian/patches/series glibc-2.23/debian/patches/series --- glibc-2.23/debian/patches/series 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/patches/series 2016-04-14 16:24:41.000000000 +0000 @@ -39,6 +39,7 @@ alpha/local-string-functions.diff alpha/submitted-fegetenv-namespace.diff alpha/submitted-termios_h.diff +alpha/submitted-fts64.diff amd64/local-blacklist-for-Intel-TSX.diff @@ -142,6 +143,8 @@ hurd-i386/cvs-mach-syscalls.mk.diff hurd-i386/local-versions.diff hurd-i386/cvs-libpthread.so.diff +hurd-i386/submitted-auxv.diff +hurd-i386/submitted-anon-mmap-shared.diff i386/local-biarch.diff i386/local-cmov.diff @@ -183,7 +186,6 @@ any/local-rtlddir-cross.diff any/local-asserth-decls.diff any/local-bindresvport_blacklist.diff -any/local-allocalim-header.diff any/local-fhs-linux-paths.diff any/local-fhs-nscd.diff any/local-ld-multiarch.diff @@ -193,7 +195,6 @@ any/local-libgcc-compat-main.diff any/local-libgcc-compat-ports.diff any/local-libgcc-compat-abilists.diff -any/local-no-pagesize.diff any/local-nss-upgrade.diff any/local-stubs_h.diff any/local-tcsetaddr.diff @@ -219,6 +220,7 @@ any/submitted-argp-attribute.diff any/submitted-dlopen-noload.diff any/cvs-tst-malloc-thread-exit.diff +any/cvs-sys-personality-h.diff # Ubuntu patches live in their own little world, to maintain sanity ubuntu/lddebug-scopes.diff diff -Nru glibc-2.23/debian/rules glibc-2.23/debian/rules --- glibc-2.23/debian/rules 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/rules 2016-04-14 16:24:15.000000000 +0000 @@ -87,7 +87,7 @@ prefix=/usr bindir=$(prefix)/bin datadir=$(prefix)/share -localedir=$(prefix)/lib/locale +complocaledir=$(prefix)/lib/locale sysconfdir=/etc libexecdir=$(prefix)/lib rootsbindir=/sbin @@ -152,7 +152,7 @@ else DEB_ARCH_REGULAR_PACKAGES = $(libc) $(libc)-dev $(libc)-dbg $(libc)-pic libc-bin libc-dev-bin multiarch-support DEB_INDEP_REGULAR_PACKAGES = glibc-doc glibc-source locales - DEB_UDEB_PACKAGES = $(libc)-udeb libnss-dns-udeb libnss-files-udeb + DEB_UDEB_PACKAGES = $(libc)-udeb ## Locales can only be pre-generated during native compiles ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) DEB_ARCH_REGULAR_PACKAGES += locales-all diff -Nru glibc-2.23/debian/rules.d/build.mk glibc-2.23/debian/rules.d/build.mk --- glibc-2.23/debian/rules.d/build.mk 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/rules.d/build.mk 2016-04-14 16:23:08.000000000 +0000 @@ -45,7 +45,7 @@ echo "LIBGD = no" >> $(DEB_BUILDDIR)/configparms echo "bindir = $(bindir)" >> $(DEB_BUILDDIR)/configparms echo "datadir = $(datadir)" >> $(DEB_BUILDDIR)/configparms - echo "localedir = $(localedir)" >> $(DEB_BUILDDIR)/configparms + echo "complocaledir = $(complocaledir)" >> $(DEB_BUILDDIR)/configparms echo "sysconfdir = $(sysconfdir)" >> $(DEB_BUILDDIR)/configparms echo "libexecdir = $(libexecdir)" >> $(DEB_BUILDDIR)/configparms echo "rootsbindir = $(rootsbindir)" >> $(DEB_BUILDDIR)/configparms diff -Nru glibc-2.23/debian/rules.d/control.mk glibc-2.23/debian/rules.d/control.mk --- glibc-2.23/debian/rules.d/control.mk 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/rules.d/control.mk 2016-04-14 16:23:08.000000000 +0000 @@ -40,8 +40,6 @@ cat debian/control.in/kfreebsd-i386 >> $@T cat debian/control.in/x32 >> $@T cat debian/control.in/opt >> $@T - cat debian/control.in/libnss-dns-udeb >> $@T - cat debian/control.in/libnss-files-udeb >> $@T sed -e 's%@libc@%$(libc)%g' -e 's%@GLIBC_VERSION@%$(GLIBC_VERSION)%g' < $@T > debian/control rm $@T touch $@ diff -Nru glibc-2.23/debian/rules.d/debhelper.mk glibc-2.23/debian/rules.d/debhelper.mk --- glibc-2.23/debian/rules.d/debhelper.mk 2016-03-23 00:46:07.000000000 +0000 +++ glibc-2.23/debian/rules.d/debhelper.mk 2016-04-14 16:23:08.000000000 +0000 @@ -216,7 +216,7 @@ rtld_so=`LANG=C LC_ALL=C readelf -l debian/tmp-$$curpass/usr/bin/iconv | grep "interpreter" | sed -e 's/.*interpreter: \(.*\)]/\1/g'`; \ case "$$curpass:$$slibdir" in \ libc:*) \ - templates="libc libc-dev libc-pic libc-udeb libnss-dns-udeb libnss-files-udeb" \ + templates="libc libc-dev libc-pic libc-udeb" \ pass="" \ suffix="" \ ;; \ diff -Nru glibc-2.23/debian/shlibs-add-udebs glibc-2.23/debian/shlibs-add-udebs --- glibc-2.23/debian/shlibs-add-udebs 2016-03-10 10:14:20.000000000 +0000 +++ glibc-2.23/debian/shlibs-add-udebs 2016-04-14 16:23:01.000000000 +0000 @@ -37,16 +37,9 @@ # in debian/debhelper.in; $W replaces any "*" wildcards there. expr_libc1="ld$W libm-$W libm libdl$W libresolv$W libc-$W libc" expr_libc2="libutil$W libcrypt$W librt$W libpthread$W libmvec$W" +expr_libc3="libnss_dns$W libnss_files$W" expr_hurd="libmachuser$W libhurduser$W" -expr_nss_dns="libnss_dns$W" -expr_nss_files="libnss_files$W" -for expr in $expr_libc1 $expr_libc2 $expr_hurd; do +for expr in $expr_libc1 $expr_libc2 $expr_libc3 $expr_hurd; do add_udeb_line "$expr" $package-udeb done -for expr in $expr_nss_dns; do - add_udeb_line "$expr" libnss-dns-udeb -done -for expr in $expr_nss_files; do - add_udeb_line "$expr" libnss-files-udeb -done