public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] More tunable fixes
@ 2024-04-30 19:25 Adhemerval Zanella
  2024-04-30 19:25 ` [PATCH 1/4] elf: Only process multiple tunable once (BZ 31686) Adhemerval Zanella
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2024-04-30 19:25 UTC (permalink / raw)
  To: libc-alpha; +Cc: Joe Simmons-Talbott, Siddhesh Poyarekar

The 680c597e9c3 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 (BZ 31686).

While fixing this issue, I noted that the new glibc.rtld.enable_secure
check could be optimized a bit to avoid the string comparison on the
tunable loop.

I also found an issue where it does have the handle case where the
environment alias is handled before the GLIBC_TUNABLES, which will
change the tunable even if glibc.rtld.enable_secure it set to 0.  Fixing
it allows us to optimize the environment alias parsing a bit, since only
tunable with aliases need to be checked (instead of the whole list).

Adhemerval Zanella (4):
  elf: Only process multiple tunable once (BZ 31686)
  elf: Remove glibc.rtld.enable_secure check from parse_tunables_string
  support: Add envp argument to support_capture_subprogram
  elf: Make glibc.rtld.enable_secure ignore alias environment variables

 elf/dl-tunables.c                          | 112 ++++++++++++------
 elf/tst-audit18.c                          |   2 +-
 elf/tst-audit19b.c                         |   2 +-
 elf/tst-audit22.c                          |   2 +-
 elf/tst-audit23.c                          |   2 +-
 elf/tst-audit25a.c                         |   4 +-
 elf/tst-audit25b.c                         |   4 +-
 elf/tst-glibc-hwcaps-2-cache.c             |   2 +-
 elf/tst-rtld-run-static.c                  |   4 +-
 elf/tst-tunables-enable_secure.c           | 131 ++++++++++++++++++---
 elf/tst-tunables.c                         |  61 +++++++++-
 scripts/gen-tunables.awk                   |  64 +++++++---
 support/capture_subprocess.h               |   9 +-
 support/subprocess.h                       |   7 +-
 support/support_capture_subprocess.c       |   5 +-
 support/support_subprocess.c               |   5 +-
 support/tst-support_capture_subprocess.c   |   2 +-
 sysdeps/aarch64/multiarch/memset_generic.S |   4 +
 sysdeps/sparc/sparc64/rtld-memset.c        |   3 +
 sysdeps/x86/tst-hwcap-tunables.c           |   2 +-
 20 files changed, 333 insertions(+), 94 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-05-02 11:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30 19:25 [PATCH 0/4] More tunable fixes Adhemerval Zanella
2024-04-30 19:25 ` [PATCH 1/4] elf: Only process multiple tunable once (BZ 31686) Adhemerval Zanella
2024-05-01 12:54   ` Florian Weimer
2024-05-01 14:19     ` Adhemerval Zanella Netto
2024-05-01 16:30   ` Siddhesh Poyarekar
2024-04-30 19:25 ` [PATCH 2/4] elf: Remove glibc.rtld.enable_secure check from parse_tunables_string Adhemerval Zanella
2024-05-01 17:15   ` Siddhesh Poyarekar
2024-04-30 19:25 ` [PATCH 3/4] support: Add envp argument to support_capture_subprogram Adhemerval Zanella
2024-04-30 20:06   ` Joe Simmons-Talbott
2024-04-30 19:25 ` [PATCH 4/4] elf: Make glibc.rtld.enable_secure ignore alias environment variables Adhemerval Zanella
2024-05-01 17:40   ` Siddhesh Poyarekar
2024-05-01 18:00     ` Adhemerval Zanella Netto
2024-05-02 11:03       ` Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).