public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v6 0/3] x86_64: aarch64: Set call number just before syscall
@ 2023-04-24 15:03 Joe Simmons-Talbott
  2023-04-24 15:03 ` [PATCH v6 1/3] x86_64: Set the syscall register right before doing the syscall Joe Simmons-Talbott
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Joe Simmons-Talbott @ 2023-04-24 15:03 UTC (permalink / raw)
  To: libc-alpha; +Cc: Joe Simmons-Talbott

To make binary call tree analysis easier place the syscall number into
the register just before the syscall is made.  Only do this if the
syscall number is a constant integer.

Compiler optimizations can place quite a few instructions between the
setting of the syscall number and the syscall instruction.  During call
tree analysis the number of instructions between the two can lead to
more difficulty for both tools and humans in properly identifying the
syscall number.  Having the syscall number set in the prior instruction
to the syscall instruction makes this task easier and less error prone.
Being able to reliably identify syscalls made by a given API will make
it easier to understand and verify the safety and security of glibc.

Tested on x86_64 and aarch64.

Chnages to v5:
  * aarch64: Remove '\n\t' from asm.
  * x86_64: Remove unused macros.

Changes to v4:
  * aarch64: Move generated comment.  Remove unused macros from earlier
  version.

  * Added patch
    - nptl: Convert indirect syscall numbers to compile time numeric
      values.

Changes to v3:
  * x86_64: Combine two inline asms into one.
    - Suggested by "H.J. Lu" <hjl.tools@gmail.com>

Changes to v2:
  * Add a more detailed commit message.
  
Changes to v1:
  * aarch64: Combine two inline asms into one.  Avoid loading name twice.

Joe Simmons-Talbott (3):
  x86_64: Set the syscall register right before doing the syscall.
  aarch64: Set the syscall register right before doing the syscall.
  nptl: Use direct syscall numbers in setxid

 nptl/nptl_setxid.c                       | 136 ++++++++++++++++++++++-
 sysdeps/unix/sysv/linux/aarch64/sysdep.h |  29 +++--
 sysdeps/unix/sysv/linux/x86_64/sysdep.h  |  24 ++--
 3 files changed, 164 insertions(+), 25 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2023-06-28 19:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-24 15:03 [PATCH v6 0/3] x86_64: aarch64: Set call number just before syscall Joe Simmons-Talbott
2023-04-24 15:03 ` [PATCH v6 1/3] x86_64: Set the syscall register right before doing the syscall Joe Simmons-Talbott
2023-05-15 14:15   ` Joe Simmons-Talbott
2023-05-15 16:20     ` H.J. Lu
2023-05-25 18:07   ` Joe Simmons-Talbott
2023-05-25 18:40     ` Noah Goldstein
2023-05-26  7:04       ` Florian Weimer
2023-05-26 12:59         ` Joe Simmons-Talbott
2023-05-26 21:18           ` Noah Goldstein
2023-05-30 10:13             ` Florian Weimer
2023-05-31 18:23               ` Noah Goldstein
2023-06-28 19:17                 ` Joe Simmons-Talbott
2023-04-24 15:03 ` [PATCH v6 2/3] aarch64: " Joe Simmons-Talbott
2023-05-09  7:47   ` Szabolcs Nagy
2023-04-24 15:03 ` [PATCH v6 3/3] nptl: Use direct syscall numbers in setxid Joe Simmons-Talbott
2023-04-24 15:17   ` Xi Ruoyao
2023-04-26  9:46     ` Szabolcs Nagy
2023-04-28 10:52       ` Florian Weimer
2023-04-26 12:39     ` Cristian Rodríguez
2023-04-26 13:24       ` Szabolcs Nagy
2023-05-25 18:07   ` Joe Simmons-Talbott
2023-05-08 14:13 ` [PATCH v6 0/3] x86_64: aarch64: Set call number just before syscall Joe Simmons-Talbott

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