glibc:hjl/pr17711/2.21

Last commit made on 2015-08-01
Get this branch:
git clone -b hjl/pr17711/2.21 https://git.launchpad.net/glibc

Branch merges

Branch information

Name:
hjl/pr17711/2.21
Repository:
lp:glibc

Recent commits

2702b16... by "H.J. Lu" <email address hidden>

Replace __attribute__((visibility("protected")))

With copy relocation, address of protected data defined in the shared
library may be external. Compiler shouldn't asssume protected data will
be local. But due to

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248

__attribute__((visibility("protected"))) doesn't work correctly, we need
to use asm (".protected xxx") instead.

Cherry-pick from master: e0ed2fb40a0e29c43cf60addc74741dab15f2e05
 * elf/ifuncdep2.c (global): Replace
 __attribute__((visibility("protected"))) with
 asm (".protected global").
 * elf/ifuncmod1.c (global): Likewise.
 * elf/ifuncmod5.c (global): Likewise.

d8700f7... by "H.J. Lu" <email address hidden>

Add a testcase for copy reloc against protected data

Linkers in some versions of binutils 2.25 and 2.26 don't support protected
data symbol with error messsage like:

/usr/bin/ld: copy reloc against protected `bar' is invalid
/usr/bin/ld: failed to set dynamic section sizes: Bad value

We check if linker supports copy reloc against protected data symbol to
avoid running the test if linker is broken.

Cherry-pick from master: 83569fb894050db7430047da2219ca50c68f882a
 [BZ #17711]
 * config.make.in (have-protected-data): New.
 * configure.ac: Check linker support for protected data symbol.
 * configure: Regenerated.
 * elf/Makefile (modules-names): Add tst-protected1moda and
 tst-protected1modb if $(have-protected-data) is yes.
 (tests): Add tst-protected1a and tst-protected1b if
 $(have-protected-data) is yes.
 ($(objpfx)tst-protected1a): New.
 ($(objpfx)tst-protected1b): Likewise.
 (tst-protected1modb.so-no-z-defs): Likewise.
 * elf/tst-protected1a.c: New file.
 * elf/tst-protected1b.c: Likewise.
 * elf/tst-protected1mod.h: Likewise.
 * elf/tst-protected1moda.c: Likewise.
 * elf/tst-protected1modb.c: Likewise.

eaf2df7... by "H.J. Lu" <email address hidden>

Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86

With copy relocation, address of protected data defined in the shared
library may be external. When there is a relocation against the
protected data symbol within the shared library, we need to check if we
should skip the definition in the executable copied from the protected
data. This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
it for x86. If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
will skip the data definition in the executable from copy reloc.

Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
 [BZ #17711]
 * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
 indicates it is called from do_lookup_x on relocation against
 protected data, skip the data definion in the executable from
 copy reloc.
 (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
 instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
 EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
 * sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
 New. Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
 otherwise to 0.
 * sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
 * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
 to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
 * sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
 * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
 to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.

9789082... by Mike Frysinger

ia64: atomic.h: fix atomic_exchange_and_add 64bit handling

Way back in 2005 the atomic_exchange_and_add function was cleaned up to
avoid the explicit size checking and instead let gcc handle things itself.
Unfortunately that change ended up leaving beyond a cast to int, even when
the incoming value was a long. This has flown under the radar for a long
time due to the function not being heavily used in the tree (especially as
a full 64bit field), but a recent change to semaphores made some nptl tests
fail reliably. This is due to the code packing two 32bit values into one
64bit variable (where the high 32bits contained the number of waiters), and
then the whole variable being atomically updated between threads. On ia64,
that meant we never atomically updated the count, so sometimes the sem_post
would not wake up the waiters.

(cherry picked from commit cf31a2c79957936b60de34ea1e718e892baf669c)

8a4e5cc... by Ppluzhnikov-google

Fix BZ #17269 -- _IO_wstr_overflow integer overflow

(cherry picked from commit bdf1ff052a8e23d637f2c838fa5642d78fcedc33)

fe7b113... by Andreas Schwab <email address hidden>

Fix read past end of pattern in fnmatch (bug 18032)

(cherry picked from commit 4a28f4d55a6cc33474c0792fe93b5942d81bf185)

d679497... by Mike Frysinger

sparc: fix sigaction for 32bit builds [BZ #18694]

Commit a059d359d86130b5fa74e04a978c8523a0293f77 changed the sigaction
struct to pass conform tests, but it ended up also changing the ABI for
32 bit builds. For 64 bit builds, changing the long to two ints works,
but for 32 bit builds, it inserts 4 extra bytes. This leads to many
packages randomly failing like bash that spews things like:
 configure: line 471: wait_for: No record of process 0

Bracket the new member by a wordsize check to fix the ABI for 32bit.

(cherry picked from commit 7fde904c73c57faea48c9679bbdc0932d81b3a2f)

01b07c7... by Arjun Shankar <email address hidden>

CVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]

(cherry picked from commit 2959eda9272a033863c271aff62095abd01bd4e3)

75adf43... by Evangelos Foutras

Fix __memcpy_chk on non-SSE2 CPUs

In commit 8b4416d, the 1: jump label in __mempcpy_chk was accidentally
moved. This resulted in failures of mempcpy on CPU without SSE2.

(cherry picked from commit 132a1328eccd20621b77f7810eebbeec0a1af187)

c66e8b9... by Florian Weimer

NEWS: Also mention CVE-2015-1473