linux-stable/arch/mips
Aurelien Jarno 79b4a9cf0e
MIPS: scall64-o32: Fix indirect syscall number load
Commit 4c21b8fd8f (MIPS: seccomp: Handle indirect system calls (o32))
added indirect syscall detection for O32 processes running on MIPS64,
but it did not work correctly for big endian kernel/processes. The
reason is that the syscall number is loaded from ARG1 using the lw
instruction while this is a 64-bit value, so zero is loaded instead of
the syscall number.

Fix the code by using the ld instruction instead. When running a 32-bit
processes on a 64 bit CPU, the values are properly sign-extended, so it
ensures the value passed to syscall_trace_enter is correct.

Recent systemd versions with seccomp enabled whitelist the getpid
syscall for their internal  processes (e.g. systemd-journald), but call
it through syscall(SYS_getpid). This fix therefore allows O32 big endian
systems with a 64-bit kernel to run recent systemd versions.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Cc: <stable@vger.kernel.org> # v3.15+
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
2019-04-15 10:35:12 -07:00
..
alchemy A few early MIPS fixes for 4.21: 2019-01-05 12:48:25 -08:00
ar7 net: phy: fixed-phy: Drop GPIO from fixed_phy_add() 2019-02-04 18:33:36 -08:00
ath25 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
ath79 MIPS: ath79: drop !OF clock code 2019-01-22 11:17:22 -08:00
bcm47xx A small batch of MIPS fixes for 5.1: 2019-03-19 10:50:15 -07:00
bcm63xx MIPS: BCM63XX: provide DMA masks for ethernet devices 2019-02-25 12:56:39 -08:00
bmips mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
boot Kbuild updates for v5.1 2019-03-10 17:48:21 -07:00
cavium-octeon treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
cobalt
configs fscrypt updates for v5.1 2019-03-09 10:54:24 -08:00
crypto
dec mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
emma mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
fw mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
generic MIPS: mscc: add PCB120 to the ocelot fitImage 2018-10-09 10:38:29 -07:00
include syscalls: Remove start and number from syscall_get_arguments() args 2019-04-05 09:26:43 -04:00
jazz MIPS: jazz: fix 64bit build 2019-01-09 13:14:34 -08:00
jz4740 MIPS: ingenic: Add support for appended devicetree 2019-02-21 15:55:41 -08:00
kernel MIPS: scall64-o32: Fix indirect syscall number load 2019-04-15 10:35:12 -07:00
kvm MIPS: MemoryMapID (MMID) Support 2019-02-04 10:56:41 -08:00
lantiq Here's the main MIPS pull request for v5.1: 2019-03-05 11:28:25 -08:00
lasat mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
lib MIPS: MemoryMapID (MMID) Support 2019-02-04 10:56:41 -08:00
loongson32 MIPS: Loongson32: Remove DMA & NAND devices from ls1b/board.c 2019-02-04 14:44:33 -08:00
loongson64 A small batch of MIPS fixes for 5.1: 2019-03-19 10:50:15 -07:00
math-emu mips: math-emu: no need to check return value of debugfs_create functions 2019-01-22 11:17:20 -08:00
mm treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
mti-malta MIPS: malta: Use img-ascii-lcd driver for LCD display 2018-11-20 21:05:39 -08:00
net MIPS: eBPF: Fix icache flush end address 2019-03-02 00:04:15 +01:00
netlogic mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
oprofile Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
paravirt
pci Here's the main MIPS pull request for v5.1: 2019-03-05 11:28:25 -08:00
pic32
pistachio
pmcs-msp71xx PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
pnx833x mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h 2018-10-03 11:12:25 +02:00
power
ralink mips: ralink: no need to check return value of debugfs_create functions 2019-01-22 11:17:20 -08:00
rb532 ata: rb532_cf: Convert to use GPIO descriptors 2018-12-04 17:15:25 -07:00
sgi-ip22
sgi-ip27 MIPS: SGI-IP27: rework HUB interrupts 2019-02-19 12:46:03 -08:00
sgi-ip32
sibyte Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
sni
tools
txx9 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
vdso MIPS: VDSO: Include $(ccflags-vdso) in o32,n32 .lds builds 2019-01-29 11:50:58 -08:00
vr41xx PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
Kbuild
Kbuild.platforms
Kconfig DMA mapping updates for 5.1 2019-03-10 11:54:48 -07:00
Kconfig.debug
Makefile MIPS: Add GINVT instruction helpers 2019-02-04 10:56:35 -08:00
Makefile.postlink