Commit 0ceb1ac
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>1 parent 6ce6442 commit 0ceb1ac
1 file changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2013 | 2013 | | |
2014 | 2014 | | |
2015 | 2015 | | |
2016 | | - | |
| 2016 | + | |
2017 | 2017 | | |
2018 | 2018 | | |
2019 | 2019 | | |
2020 | 2020 | | |
2021 | 2021 | | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
2022 | 2032 | | |
| 2033 | + | |
| 2034 | + | |
2023 | 2035 | | |
2024 | 2036 | | |
2025 | 2037 | | |
2026 | 2038 | | |
2027 | 2039 | | |
2028 | | - | |
| 2040 | + | |
2029 | 2041 | | |
| 2042 | + | |
2030 | 2043 | | |
| 2044 | + | |
2031 | 2045 | | |
2032 | | - | |
2033 | | - | |
| 2046 | + | |
2034 | 2047 | | |
2035 | | - | |
2036 | | - | |
| 2048 | + | |
2037 | 2049 | | |
2038 | 2050 | | |
2039 | 2051 | | |
| |||
0 commit comments