]> granicus.if.org Git - strace/commit
syscall.c: add ability to set personality based on GETREGSET iov size
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 15 Jan 2018 20:49:14 +0000 (21:49 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 16 Jan 2018 22:54:38 +0000 (22:54 +0000)
commit64fd0ce626accf9c269bd3afb8206cdccbae9a6f
tree56f1843ab3b91d63cc88cd2ada4b1c86fa329370
parenta4886a7f99db432470d6737c90c3845a5feb5ecd
syscall.c: add ability to set personality based on GETREGSET iov size

Some architectures (aarch64, s390x) use only PTRACE_GETREGSET interface
and use its size to detect current personality. Let's generalise this
approach and also avoid subtle errors when we get register but forget to
update personality, at least for those architectures.

Note that in order to employ this behaviour, architecture has to use
PTRACE_GETREGSET exclusively (no HAVE_GETREGS_OLD) and should declare
appropriate ARCH_PERSONALITY_*_IOV_SIZE macros.

* syscall.c (get_regs) [ptrace_getregset_or_getregs &&
!HAVE_GETREGS_OLD]: Call update_personality based on the value returned
in the iov_len field by PTRACE_GETREGSET.  Warn once if the returned
iov_len is unknown.
syscall.c