61bf318eac
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> |
||
---|---|---|
.. | ||
native | ||
sn | ||
uv | ||
Kbuild | ||
acenv.h | ||
acpi-ext.h | ||
acpi.h | ||
agp.h | ||
asm-offsets.h | ||
asm-prototypes.h | ||
asmmacro.h | ||
atomic.h | ||
barrier.h | ||
bitops.h | ||
bug.h | ||
bugs.h | ||
cache.h | ||
cacheflush.h | ||
checksum.h | ||
clocksource.h | ||
cpu.h | ||
cputime.h | ||
current.h | ||
cyclone.h | ||
delay.h | ||
device.h | ||
div64.h | ||
dma-mapping.h | ||
dma.h | ||
dmi.h | ||
early_ioremap.h | ||
efi.h | ||
elf.h | ||
emergency-restart.h | ||
esi.h | ||
exception.h | ||
export.h | ||
extable.h | ||
fb.h | ||
fpswa.h | ||
ftrace.h | ||
futex.h | ||
gcc_intrin.h | ||
hardirq.h | ||
hugetlb.h | ||
hw_irq.h | ||
idle.h | ||
intrinsics.h | ||
io.h | ||
iommu.h | ||
iommu_table.h | ||
iosapic.h | ||
irq.h | ||
irq_regs.h | ||
irq_remapping.h | ||
irqflags.h | ||
kdebug.h | ||
kexec.h | ||
kprobes.h | ||
kregs.h | ||
libata-portmap.h | ||
linkage.h | ||
local.h | ||
mca.h | ||
mca_asm.h | ||
meminit.h | ||
mman.h | ||
mmiowb.h | ||
mmu.h | ||
mmu_context.h | ||
mmzone.h | ||
module.h | ||
module.lds.h | ||
msidef.h | ||
nodedata.h | ||
numa.h | ||
page.h | ||
pal.h | ||
param.h | ||
parport.h | ||
patch.h | ||
pci.h | ||
percpu.h | ||
pgalloc.h | ||
pgtable.h | ||
processor.h | ||
ptrace.h | ||
sal.h | ||
sections.h | ||
serial.h | ||
shmparam.h | ||
signal.h | ||
smp.h | ||
sparsemem.h | ||
spinlock.h | ||
spinlock_types.h | ||
string.h | ||
switch_to.h | ||
syscall.h | ||
termios.h | ||
thread_info.h | ||
timex.h | ||
tlb.h | ||
tlbflush.h | ||
topology.h | ||
types.h | ||
uaccess.h | ||
unaligned.h | ||
uncached.h | ||
unistd.h | ||
unwind.h | ||
user.h | ||
ustack.h | ||
vermagic.h | ||
vga.h | ||
vmalloc.h | ||
xor.h | ||
xtp.h |