Revision 61bf318eac2c13356f7bd1c6a05421ef504ccc8a authored by Sergei Trofimovich on 13 March 2021, 05:08:27 UTC, committed by Linus Torvalds on 13 March 2021, 19:27:31 UTC
In https://bugs.gentoo.org/769614 Dmitry noticed that `ptrace(PTRACE_GET_SYSCALL_INFO)` does not return error sign properly. The bug is in mismatch between get/set errors: static inline long syscall_get_error(struct task_struct *task, struct pt_regs *regs) { return regs->r10 == -1 ? regs->r8:0; } static inline long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs) { return regs->r8; } static inline void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, int error, long val) { if (error) { /* error < 0, but ia64 uses > 0 return value */ regs->r8 = -error; regs->r10 = -1; } else { regs->r8 = val; regs->r10 = 0; } } Tested on v5.10 on rx3600 machine (ia64 9040 CPU). Link: https://lkml.kernel.org/r/20210221002554.333076-2-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> Reviewed-by: Dmitry V. Levin <ldv@altlinux.org> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0ceb1ac
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 5.5 KB |
LICENCE | -rw-r--r-- | 1.4 KB |
Makefile | -rw-r--r-- | 786 bytes |
README.Locking | -rw-r--r-- | 6.9 KB |
TODO | -rw-r--r-- | 1.9 KB |
acl.c | -rw-r--r-- | 6.7 KB |
acl.h | -rw-r--r-- | 1005 bytes |
background.c | -rw-r--r-- | 4.2 KB |
build.c | -rw-r--r-- | 12.6 KB |
compr.c | -rw-r--r-- | 11.6 KB |
compr.h | -rw-r--r-- | 3.1 KB |
compr_lzo.c | -rw-r--r-- | 2.2 KB |
compr_rtime.c | -rw-r--r-- | 2.9 KB |
compr_rubin.c | -rw-r--r-- | 8.7 KB |
compr_zlib.c | -rw-r--r-- | 5.5 KB |
debug.c | -rw-r--r-- | 25.6 KB |
debug.h | -rw-r--r-- | 8.3 KB |
dir.c | -rw-r--r-- | 23.0 KB |
erase.c | -rw-r--r-- | 13.4 KB |
file.c | -rw-r--r-- | 9.1 KB |
fs.c | -rw-r--r-- | 19.4 KB |
gc.c | -rw-r--r-- | 44.0 KB |
ioctl.c | -rw-r--r-- | 557 bytes |
jffs2_fs_i.h | -rw-r--r-- | 1.6 KB |
jffs2_fs_sb.h | -rw-r--r-- | 5.7 KB |
malloc.c | -rw-r--r-- | 7.3 KB |
nodelist.c | -rw-r--r-- | 21.3 KB |
nodelist.h | -rw-r--r-- | 17.9 KB |
nodemgmt.c | -rw-r--r-- | 28.4 KB |
os-linux.h | -rw-r--r-- | 7.4 KB |
read.c | -rw-r--r-- | 6.7 KB |
readinode.c | -rw-r--r-- | 43.2 KB |
scan.c | -rw-r--r-- | 35.3 KB |
security.c | -rw-r--r-- | 2.0 KB |
summary.c | -rw-r--r-- | 23.7 KB |
summary.h | -rw-r--r-- | 6.3 KB |
super.c | -rw-r--r-- | 10.6 KB |
symlink.c | -rw-r--r-- | 417 bytes |
wbuf.c | -rw-r--r-- | 36.9 KB |
write.c | -rw-r--r-- | 21.0 KB |
writev.c | -rw-r--r-- | 1.1 KB |
xattr.c | -rw-r--r-- | 38.3 KB |
xattr.h | -rw-r--r-- | 4.1 KB |
xattr_trusted.c | -rw-r--r-- | 1.2 KB |
xattr_user.c | -rw-r--r-- | 1.1 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...