OpenCloudOS-Kernel/arch/ia64
Sergei Trofimovich 0ceb1ace4a ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls
In https://bugs.gentoo.org/769614 Dmitry noticed that
`ptrace(PTRACE_GET_SYSCALL_INFO)` does not work for syscalls called via
glibc's syscall() wrapper.

ia64 has two ways to call syscalls from userspace: via `break` and via
`eps` instructions.

The difference is in stack layout:

1. `eps` creates simple stack frame: no locals, in{0..7} == out{0..8}
2. `break` uses userspace stack frame: may be locals (glibc provides
   one), in{0..7} == out{0..8}.

Both work fine in syscall handling cde itself.

But `ptrace(PTRACE_GET_SYSCALL_INFO)` uses unwind mechanism to
re-extract syscall arguments but it does not account for locals.

The change always skips locals registers. It should not change `eps`
path as kernel's handler already enforces locals=0 and fixes `break`.

Tested on v5.10 on rx3600 machine (ia64 9040 CPU).

Link: https://lkml.kernel.org/r/20210221002554.333076-1-slyfox@gentoo.org
Link: https://bugs.gentoo.org/769614
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-03-13 11:27:31 -08:00
..
configs arch: ia64: Remove CONFIG_OPROFILE support 2021-01-22 12:12:14 +05:30
hp/common dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00
include Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
kernel ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls 2021-03-13 11:27:31 -08:00
lib Merge branch 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:24:13 -07:00
mm mm: simplify parater of function memmap_init_zone() 2021-02-24 13:38:31 -08:00
pci ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
scripts kbuild: remove PYTHON variable 2021-02-01 10:37:19 +09:00
uv ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
Kconfig arch: ia64: Remove CONFIG_OPROFILE support 2021-01-22 12:12:14 +05:30
Kconfig.debug ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
Makefile ia64: remove redundant READELF from arch/ia64/Makefile 2021-02-28 15:22:02 +09:00
install.sh