unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v5 0/7] fix ifunc with static pie [BZ #27072]
@ 2021-01-20 15:29 Szabolcs Nagy via Libc-alpha
  2021-01-20 15:30 ` [PATCH v5 1/7] elf: Make the tunable struct definition internal only Szabolcs Nagy via Libc-alpha
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Szabolcs Nagy via Libc-alpha @ 2021-01-20 15:29 UTC (permalink / raw)
  To: libc-alpha

v5:
- reordered patches.
- config check SUPPORT_STATIC_PIE (instead of PI_STATIC_AND_HIDDEN)
- fix __ehdr_start differently: just drop weak.
- update commit messages for hidden visibility changes.

v4:
- added patches from H.J.Lu:
	- x86: fix libmvec tests
	- x86: fix syscalls in libc_enable_secure
	- x86: avoid relative reloc for _dl_sysinfo
	- x86: add ifunc test
- i386 cannot mark all symbols hidden, so use fine grain
  marking in files that participate in early code before
  static pie self relocation.
- the patch that makes all libc symbols hidden is still
  included: it is now only an optimization for non-i386
  targets.

v3:
- refactor tunables: move internals out of dl-tunables.h
- use generated max string length in the tunables list
  instead of magic values.

v2:
- check PI_STATIC_AND_HIDDEN for --enable-static-pie
- change string buffer sizes in the tunables
- fix env_alias == NULL logic in __tunables_init
- move __ehdr_start processing after self relocation


force pushed into nsz/bug27072 branch.

Tested on aarch64, i686 and x86_64 with and without the last
patch (some of the make check is still running though).

Issues that are not addressed:
- tunables try to allocate memory even with non-suid exe.
  allocation is only needed for rewriting the GLIBC_TUNABLES
  env var. (i think a case can be made that if anything there
  is TUNABLE_SECLEVEL_SXID_ERASE then this env var would be
  simply dropped, that would simplify this significantly).
- __sbrk only needs the hidden visibility magic because of
  tunables, ideally we would not do allocations before self
  relocation.
- tunable list data structure is not optimized for compactness.

Szabolcs Nagy (7):
  elf: Make the tunable struct definition internal only
  elf: Avoid RELATIVE relocs in __tunables_init
  configure: Check for static PIE support
  csu: Avoid weak ref for __ehdr_start in static PIE
  Use hidden visibility for early static PIE code
  csu: Move static pie self relocation later [BZ #27072]
  Make libc symbols hidden in static PIE

 config.h.in                                  |  3 ++
 configure                                    | 13 ++++++
 configure.ac                                 |  4 ++
 csu/libc-start.c                             | 15 ++++++-
 elf/dl-reloc-static-pie.c                    |  2 +
 elf/dl-support.c                             |  6 +++
 elf/dl-tunable-types.h                       | 42 +++++++++++++++-----
 elf/dl-tunables.c                            |  6 ++-
 elf/dl-tunables.h                            | 35 ++++------------
 elf/enbl-secure.c                            |  4 ++
 include/libc-symbols.h                       |  9 ++++-
 misc/sbrk.c                                  |  4 ++
 scripts/gen-tunables.awk                     | 16 +++++++-
 sysdeps/aarch64/configure                    |  4 ++
 sysdeps/aarch64/configure.ac                 |  3 ++
 sysdeps/i386/configure                       |  3 ++
 sysdeps/i386/configure.ac                    |  3 ++
 sysdeps/unix/sysv/linux/aarch64/libc-start.c |  5 +++
 sysdeps/x86/libc-start.c                     |  5 +++
 sysdeps/x86_64/configure                     |  3 ++
 sysdeps/x86_64/configure.ac                  |  3 ++
 21 files changed, 144 insertions(+), 44 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2021-01-27  9:44 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 15:29 [PATCH v5 0/7] fix ifunc with static pie [BZ #27072] Szabolcs Nagy via Libc-alpha
2021-01-20 15:30 ` [PATCH v5 1/7] elf: Make the tunable struct definition internal only Szabolcs Nagy via Libc-alpha
2021-01-20 15:30 ` [PATCH v5 2/7] elf: Avoid RELATIVE relocs in __tunables_init Szabolcs Nagy via Libc-alpha
2021-01-20 15:30 ` [PATCH v5 3/7] configure: Check for static PIE support Szabolcs Nagy via Libc-alpha
2021-01-21 13:59   ` Adhemerval Zanella via Libc-alpha
2021-01-20 15:31 ` [PATCH v5 4/7] csu: Avoid weak ref for __ehdr_start in static PIE Szabolcs Nagy via Libc-alpha
2021-01-20 15:36   ` H.J. Lu via Libc-alpha
2021-01-21 14:01   ` Adhemerval Zanella via Libc-alpha
2021-01-20 15:31 ` [PATCH v5 5/7] Use hidden visibility for early static PIE code Szabolcs Nagy via Libc-alpha
2021-01-21 14:04   ` Adhemerval Zanella via Libc-alpha
2021-01-20 15:31 ` [PATCH v5 6/7] csu: Move static pie self relocation later [BZ #27072] Szabolcs Nagy via Libc-alpha
2021-01-21 14:07   ` Adhemerval Zanella via Libc-alpha
2021-01-21 15:38     ` Szabolcs Nagy via Libc-alpha
2021-01-20 15:31 ` [PATCH v5 7/7] Make libc symbols hidden in static PIE Szabolcs Nagy via Libc-alpha
2021-01-21 14:10   ` Adhemerval Zanella via Libc-alpha
2021-01-21 15:44     ` Szabolcs Nagy via Libc-alpha
2021-01-22  1:25   ` Tulio Magno Quites Machado Filho via Libc-alpha
2021-01-22  9:41     ` Szabolcs Nagy via Libc-alpha
2021-01-27  9:44   ` Andreas Schwab

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).