public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] fix ifunc with static pie [BZ #27072]
@ 2021-01-08 16:19 Szabolcs Nagy
  2021-01-08 16:19 ` [PATCH v2 1/4] configure: Require PI_STATIC_AND_HIDDEN for static pie Szabolcs Nagy
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Szabolcs Nagy @ 2021-01-08 16:19 UTC (permalink / raw)
  To: libc-alpha

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

I think this is in a reasonable shape now, but there are still
some issues:
- tunables try to allocate memory (tunable_strdup) even if
  that's not necessary: only setuid binaries need this (in
  case there is a TUNABLE_SECLEVEL_SXID_ERASE tunable).
  this adds a lot of complexity and a failure path to the early
  init code. i think that if there is any such tunable then the
  entire GLIBC_TUNABLE= should just be dropped.
- tunable strings could be stored more compactly (and without
  arbitrary size limits) as an optimization. (can be done once
  there are too many tunables.)
- all symbols are forced hidden in libc.a, but i think lib*.a
  should do the same. (other than lib*_nonshared.a)

Szabolcs Nagy (4):
  configure: Require PI_STATIC_AND_HIDDEN for static pie
  Make libc symbols hidden in static PIE
  elf: Avoid RELATIVE relocs in __tunables_init
  csu: Move static pie self relocation later [BZ #27072]

 configure                | 14 +++++++++++++
 configure.ac             |  5 +++++
 csu/libc-start.c         | 44 +++++++++++++++++++++++-----------------
 elf/dl-tunables.c        |  2 +-
 elf/dl-tunables.h        |  4 ++--
 include/libc-symbols.h   |  8 ++++++--
 scripts/gen-tunables.awk |  2 +-
 7 files changed, 54 insertions(+), 25 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2021-01-11 12:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 16:19 [PATCH v2 0/4] fix ifunc with static pie [BZ #27072] Szabolcs Nagy
2021-01-08 16:19 ` [PATCH v2 1/4] configure: Require PI_STATIC_AND_HIDDEN for static pie Szabolcs Nagy
2021-01-08 16:20 ` [PATCH v2 2/4] Make libc symbols hidden in static PIE Szabolcs Nagy
2021-01-08 16:20 ` [PATCH v2 3/4] elf: Avoid RELATIVE relocs in __tunables_init Szabolcs Nagy
2021-01-08 17:59   ` Adhemerval Zanella
2021-01-08 18:22     ` Siddhesh Poyarekar
2021-01-08 18:25       ` Adhemerval Zanella
2021-01-11 10:56     ` Szabolcs Nagy
2021-01-11 12:13       ` Adhemerval Zanella
2021-01-08 16:20 ` [PATCH v2 4/4] csu: Move static pie self relocation later [BZ #27072] Szabolcs Nagy
2021-01-08 17:04 ` [PATCH v2 0/4] fix ifunc with static pie " H.J. Lu
2021-01-11 10:50   ` Szabolcs Nagy

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