acrn-kernel/arch/ia64/include/asm
Sergei Trofimovich 61bf318eac ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign
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>
2021-03-13 11:27:31 -08:00
..
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 treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
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 efi: ia64: move IA64-only declarations to new asm/efi.h header 2021-01-18 13:50:37 +01:00
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 arch: ia64: Remove rest of perfmon support 2021-01-22 12:12:20 +05:30
idle.h
intrinsics.h
io.h
iommu.h
iommu_table.h
iosapic.h
irq.h ia64: remove generated/nr-irqs.h generation to fix build warning 2021-02-12 05:11:19 +09:00
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 ia64: remove unneeded header includes from <asm/mca.h> 2021-02-12 05:11:19 +09:00
mca_asm.h
meminit.h ia64: forbid using VIRTUAL_MEM_MAP with FLATMEM 2020-12-15 12:13:42 -08:00
mman.h
mmiowb.h
mmu.h
mmu_context.h ia64: use asm-generic/mmu_context.h for no-op implementations 2020-10-27 16:02:35 +01:00
mmzone.h
module.h
module.lds.h
msidef.h
nodedata.h
numa.h
page.h
pal.h ia64: do not typedef struct pal_min_state_area_s 2021-02-12 05:11:19 +09:00
param.h
parport.h
patch.h
pci.h
percpu.h
pgalloc.h
pgtable.h mm: fix prototype warning from kernel test robot 2021-02-24 13:38:31 -08:00
processor.h
ptrace.h
sal.h ia64: do not typedef struct pal_min_state_area_s 2021-02-12 05:11:19 +09:00
sections.h
serial.h
shmparam.h
signal.h
smp.h
sparsemem.h ia64: fix build failure caused by memory model changes 2021-01-17 13:31:09 +02:00
spinlock.h
spinlock_types.h
string.h
switch_to.h
syscall.h ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign 2021-03-13 11:27:31 -08:00
termios.h
thread_info.h ia64: add support for TIF_NOTIFY_SIGNAL 2020-12-12 09:17:38 -07:00
timex.h
tlb.h tlb: mmu_gather: Remove start/end arguments from tlb_gather_mmu() 2021-01-29 20:02:29 +01:00
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