]> Git Repo - linux.git/commit
powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs
authorNicholas Piggin <[email protected]>
Wed, 12 Oct 2022 03:53:34 +0000 (13:53 +1000)
committerMichael Ellerman <[email protected]>
Wed, 12 Oct 2022 13:49:58 +0000 (00:49 +1100)
commite237506238352f3bfa9cf3983cdab873e35651eb
tree8ee47da57029919434938413c8badf58754fa065
parentae5b6779fa8724628bbad58126a626d0cd599414
powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs

powerpc 32-bit system call (and function) calling convention for 64-bit
arguments requires the next available odd-pair (two sequential registers
with the first being odd-numbered) from the standard register argument
allocation.

The first argument register is r3, so a 64-bit argument that appears at
an even position in the argument list must skip a register (unless there
were preceding 64-bit arguments, which might throw things off). This
requires non-standard compat definitions to deal with the holes in the
argument register allocation.

With pt_regs syscall wrappers which use a standard mapper to map pt_regs
GPRs to function arguments, 32-bit kernels hit the same basic problem,
the standard definitions don't cope with the unused argument registers.

Fix this by having 32-bit kernels share those syscall definitions with
compat.

Thanks to Jason for spending a lot of time finding and bisecting this
and developing a trivial reproducer. The perfect bug report.

Reported-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: Nicholas Piggin <[email protected]>
Fixes: 7e92e01b72452 ("powerpc: Provide syscall wrapper")
Reviewed-by: Arnd Bergmann <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
arch/powerpc/include/asm/syscalls.h
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/sys_ppc32.c
arch/powerpc/kernel/syscalls/syscall.tbl
This page took 0.059086 seconds and 4 git commands to generate.