glibc/sysdeps/sparc
Adhemerval Zanella 71149c2a2e elf: Only process multiple tunable once (BZ 31686)
The 680c597e9c commit made loader reject ill-formatted strings by
first tracking all set tunables and then applying them. However, it does
not take into consideration if the same tunable is set multiple times,
where parse_tunables_string appends the found tunable without checking
if it was already in the list. It leads to a stack-based buffer overflow
if the tunable is specified more than the total number of tunables.  For
instance:

  GLIBC_TUNABLES=glibc.malloc.check=2:... (repeat over the number of
  total support for different tunable).

Instead, use the index of the tunable list to get the expected tunable
entry.  Since now the initial list is zero-initialized, the compiler
might emit an extra memset and this requires some minor adjustment
on some ports.

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

Reported-by: Yuto Maeda <maeda@cyberdefense.jp>
Reported-by: Yutaro Shimizu <shimizu@cyberdefense.jp>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit bcae44ea85)
2024-05-07 14:06:56 -03:00
..
bits Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
fpu sparc: Force calculation that raises exception 2024-01-18 08:27:44 -03:00
nptl Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
sparc32 login: structs utmp, utmpx, lastlog _TIME_BITS independence (bug 30701) 2024-05-02 13:20:27 +02:00
sparc64 elf: Only process multiple tunable once (BZ 31686) 2024-05-07 14:06:56 -03:00
sys
abort-instr.h
atomic-machine.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
backtrace.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
configure configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
configure.ac
cpu_relax.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
crti.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
crtn.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-tls.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
elf-initfini.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
gccframe.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
ldsodefs.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
machine-gmon.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
Makefile Remove references to the defunct db2 subdir 2023-08-21 18:20:53 +02:00
mempcpy.S
preconfigure
sparc-ifunc.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
sparc-mcount.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
stackinfo.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
Subdirs
sysdep.h sparc: Remove unwind information from signal return stubs [BZ #31244] 2024-01-18 08:27:44 -03:00
unwind-arch.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
utmp-size.h login: Check default sizes of structs utmp, utmpx, lastlog 2024-05-02 13:20:27 +02:00