public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
* [2.31/2.30] [PATCH 0/6] Properly pass long to syscall [BZ #25810/#25896]
@ 2020-04-30 19:34 H.J. Lu
  2020-04-30 19:34 ` [2.31/2.30] [PATCH 1/6] x32: Properly pass long to syscall [BZ #25810] H.J. Lu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: H.J. Lu @ 2020-04-30 19:34 UTC (permalink / raw)
  To: libc-stable

X32 has 32-bit long and pointer with 64-bit off_t.  Since x32 psABI
requires that pointers passed in registers must be zero-extended to
64bit, x32 can share many syscall interfaces with LP64.  When a LP64
syscall with long and unsigned long arguments is used for x32, these
arguments must be properly extended to 64-bit.  Otherwise if the upper
32 bits of the register have undefined value, such a syscall will be
rejected by kernel.

This patch set backports fixes from master branch to properly extend
long argument to long long before passing it to syscall for x32.  It
also adds a C wrapper to pass arguments in

/* Control process execution.  */
extern int prctl (int __option, ...) __THROW;

to prctl syscall:

extern int prctl (int, unsigned long int, unsigned long int,
		  unsigned long int, unsigned long int);

I will check it into 2.31 and 2.30 branches next Thursday.

H.J. Lu (6):
  x32: Properly pass long to syscall [BZ #25810]
  Add SYSCALL_ULONG_ARG_[12] to pass long to syscall [BZ #25810]
  Add a syscall test for [BZ #25810]
  Mark unsigned long arguments with U in more syscalls [BZ #25810]
  Add C wrappers for process_vm_readv/process_vm_writev [BZ #25810]
  Add a C wrapper for prctl [BZ #25896]

 include/sys/prctl.h                         |   1 +
 misc/Makefile                               |   2 +-
 misc/tst-syscalls.c                         | 167 ++++++++++++++++++++
 sysdeps/unix/make-syscalls.sh               |  24 +++
 sysdeps/unix/syscall-template.S             |  49 +++++-
 sysdeps/unix/syscalls.list                  |  22 +--
 sysdeps/unix/sysv/linux/Makefile            |   4 +-
 sysdeps/unix/sysv/linux/prctl.c             |  42 +++++
 sysdeps/unix/sysv/linux/process_vm_readv.c  |  32 ++++
 sysdeps/unix/sysv/linux/process_vm_writev.c |  32 ++++
 sysdeps/unix/sysv/linux/syscalls.list       |  41 +++--
 sysdeps/unix/sysv/linux/x86_64/sysdep.h     |  86 +++++++---
 sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h |  35 ++++
 13 files changed, 479 insertions(+), 58 deletions(-)
 create mode 100644 misc/tst-syscalls.c
 create mode 100644 sysdeps/unix/sysv/linux/prctl.c
 create mode 100644 sysdeps/unix/sysv/linux/process_vm_readv.c
 create mode 100644 sysdeps/unix/sysv/linux/process_vm_writev.c

-- 
2.26.2


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

end of thread, other threads:[~2020-04-30 19:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 19:34 [2.31/2.30] [PATCH 0/6] Properly pass long to syscall [BZ #25810/#25896] H.J. Lu
2020-04-30 19:34 ` [2.31/2.30] [PATCH 1/6] x32: Properly pass long to syscall [BZ #25810] H.J. Lu
2020-04-30 19:34 ` [2.31/2.30] [PATCH 2/6] Add SYSCALL_ULONG_ARG_[12] to " H.J. Lu
2020-04-30 19:34 ` [2.31/2.30] [PATCH 3/6] Add a syscall test for " H.J. Lu
2020-04-30 19:34 ` [2.31/2.30] [PATCH 4/6] Mark unsigned long arguments with U in more syscalls " H.J. Lu
2020-04-30 19:34 ` [2.31/2.30] [PATCH 5/6] Add C wrappers for process_vm_readv/process_vm_writev " H.J. Lu
2020-04-30 19:34 ` [2.31/2.30] [PATCH 6/6] Add a C wrapper for prctl [BZ #25896] H.J. Lu

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