android_kernel_samsung_a7y1.../arch/mips
Aurelien Jarno 2f86833b3e MIPS: scall64-o32: Fix indirect syscall number load
commit 79b4a9cf0e2ea8203ce777c8d5cfa86c71eae86e upstream.

Commit 4c21b8fd8f14 (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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 16:38:39 +02:00
..
alchemy A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ar7 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ath25 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ath79 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcm47xx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcm63xx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bmips A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
boot A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cavium-octeon A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cobalt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
configs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dec A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
emma A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fw A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
generic A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
include MIPS: Fix kernel crash for R6 in jump label branch function 2020-04-06 10:58:13 +02:00
jazz A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
jz4740 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kernel MIPS: scall64-o32: Fix indirect syscall number load 2020-04-06 16:38:39 +02:00
kvm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lantiq A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lasat A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lib A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
loongson32 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
loongson64 mips: loongson64: lemote-2f: Add IRQF_NO_SUSPEND to "cascade" irqaction. 2020-04-06 10:58:13 +02:00
math-emu A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mti-malta A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mti-sead3 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netlogic A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
oprofile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
paravirt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pistachio A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pmcs-msp71xx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pnx833x A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
power A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ralink A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rb532 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sgi-ip22 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sgi-ip27 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sgi-ip32 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sibyte A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sni A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
txx9 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vdso A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vr41xx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xilfpga A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kbuild A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kbuild.platforms A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.debug A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30