public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: libc-alpha@sourceware.org
Subject: [PATCH v3 0/5] fix ifunc with static pie [BZ #27072]
Date: Tue, 12 Jan 2021 17:21:25 +0000	[thread overview]
Message-ID: <cover.1610471272.git.szabolcs.nagy@arm.com> (raw)

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 (with a gcc8 bug
workaround for aarch64)

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.
- tunable list is not optimized for compactness.
- all symbols are forced hidden in libc.a, but i think lib*.a
  should do the same. (other than lib*_nonshared.a)

Szabolcs Nagy (5):
  configure: Require PI_STATIC_AND_HIDDEN for static pie
  Make libc symbols hidden in static PIE
  elf: Make the tunable struct definition internal only
  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-tunable-types.h   | 42 +++++++++++++++++++++++++++++---------
 elf/dl-tunables.c        |  2 +-
 elf/dl-tunables.h        | 35 ++++++++------------------------
 include/libc-symbols.h   |  8 ++++++--
 scripts/gen-tunables.awk | 16 +++++++++++++--
 8 files changed, 105 insertions(+), 61 deletions(-)

-- 
2.17.1


             reply	other threads:[~2021-01-12 17:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 17:21 Szabolcs Nagy [this message]
2021-01-12 17:21 ` [PATCH v3 1/5] configure: Require PI_STATIC_AND_HIDDEN for static pie Szabolcs Nagy
2021-01-12 18:38   ` Adhemerval Zanella
2021-01-12 17:22 ` [PATCH v3 2/5] Make libc symbols hidden in static PIE Szabolcs Nagy
2021-01-12 23:09   ` H.J. Lu
2021-01-13  0:02     ` H.J. Lu
2021-01-13  0:33       ` H.J. Lu
2021-01-13  1:19         ` H.J. Lu
2021-01-13  9:50           ` Szabolcs Nagy
2021-01-14 11:17             ` Szabolcs Nagy
2021-01-14 15:39               ` H.J. Lu
2021-01-15  3:36               ` H.J. Lu
2021-01-15  4:29                 ` H.J. Lu
2021-01-15 11:25                 ` Szabolcs Nagy
2021-01-15 13:43                   ` H.J. Lu
2021-01-15 14:27                     ` Szabolcs Nagy
2021-01-15 15:28                       ` H.J. Lu
2021-01-15 22:42                         ` H.J. Lu
2021-01-16  0:41                           ` H.J. Lu
2021-01-16 13:18                             ` H.J. Lu
2021-01-18 16:22                               ` Szabolcs Nagy
2021-01-12 17:22 ` [PATCH v3 3/5] elf: Make the tunable struct definition internal only Szabolcs Nagy
2021-01-13 17:38   ` Adhemerval Zanella
2021-01-12 17:22 ` [PATCH v3 4/5] elf: Avoid RELATIVE relocs in __tunables_init Szabolcs Nagy
2021-01-13 17:42   ` Adhemerval Zanella
2021-01-12 17:23 ` [PATCH v3 5/5] csu: Move static pie self relocation later [BZ #27072] Szabolcs Nagy
2021-01-12 22:55   ` H.J. Lu
2021-01-14 15:49     ` H.J. Lu
2021-01-14 15:52       ` H.J. Lu
2021-01-14 16:01         ` H.J. Lu
2021-01-14 16:26           ` H.J. Lu
2021-01-14 17:19             ` Szabolcs Nagy
2021-01-14 17:59               ` Szabolcs Nagy
2021-01-14 17:05           ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1610471272.git.szabolcs.nagy@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).