android_kernel_oneplus_msm8998/arch/mips
Aurelien Jarno 15c2ac78cb MIPS: scall64-o32: Fix indirect syscall number load
commit 79b4a9cf0e2ea8203ce777c8d5cfa86c71eae86e upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-16 19:44:43 +02:00
..
alchemy pcmcia: db1xxx_ss: fix last irq_to_gpio user 2016-04-20 15:42:09 +09:00
ar7 MIPS: AR7: ensure the port type's FCR value is used 2018-01-23 19:50:18 +01:00
ath25 MIPS: ath25: Check for kzalloc allocation failure 2018-03-18 11:17:49 +01:00
ath79 MIPS: ath79: fix system restart 2018-09-26 08:35:05 +02:00
bcm47xx Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum" 2018-09-05 09:18:36 +02:00
bcm63xx
bmips
boot MIPS: Align kernel load address to 64KB 2019-01-13 10:05:31 +01:00
cavium-octeon MIPS: OCTEON: fix out of bounds array access on CN68XX 2018-11-21 09:27:36 +01:00
cobalt
configs MIPS: ath79: Enable OF serial ports in the default config 2019-03-23 08:44:16 +01:00
dec MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression 2018-11-10 07:41:40 -08:00
emma
fw
include MIPS: Fix kernel crash for R6 in jump label branch function 2019-04-03 06:23:14 +02:00
jazz MIPS: jazz: fix 64bit build 2019-03-23 08:44:16 +01:00
jz4740 MIPS: jz4740: Bump zload address 2018-09-26 08:35:06 +02:00
kernel MIPS: scall64-o32: Fix indirect syscall number load 2019-05-16 19:44:43 +02:00
kvm KVM: Fix spelling mistake: "cop_unsuable" -> "cop_unusable" 2018-05-30 07:48:50 +02:00
lantiq MIPS: Lantiq: Fix another request_mem_region() return code check 2017-10-08 10:14:18 +02:00
lasat
lib MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 2018-09-05 09:18:40 +02:00
loongson32
loongson64 mips: loongson64: lemote-2f: Add IRQF_NO_SUSPEND to "cascade" irqaction. 2019-04-03 06:23:14 +02:00
math-emu MIPS: math-emu: Fix final emulation phase for certain instructions 2017-12-25 14:22:15 +01:00
mm mm: replace get_user_pages_unlocked() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
mti-malta MIPS: Malta: Fix IOCU disable switch read for MIPS64 2016-10-07 15:23:43 +02:00
mti-sead3
net MIPS: BPF: Fix multiple problems in JIT skb access helpers. 2018-03-22 09:23:25 +01:00
netlogic MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds 2017-11-21 09:21:22 +01:00
oprofile
paravirt
pci MIPS: OCTEON: don't set octeon_dma_bar_type if PCI is disabled 2019-02-20 10:13:18 +01:00
pistachio
pmcs-msp71xx
pnx833x
power
ralink MIPS: ralink: Fix mt7620 nd_sd pinmux 2018-12-13 09:21:30 +01:00
rb532
sgi-ip22 MIPS: ip22: Fix ip28 build for modern gcc 2017-03-18 19:09:56 +08:00
sgi-ip27
sgi-ip32
sibyte MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur 2019-01-26 09:42:53 +01:00
sni
txx9 MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS 2018-05-30 07:48:56 +02:00
vdso MIPS: VDSO: Include $(ccflags-vdso) in o32,n32 .lds builds 2019-02-20 10:13:19 +01:00
vr41xx
xilfpga
Kbuild
Kbuild.platforms
Kconfig MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur 2019-01-26 09:42:53 +01:00
Kconfig.debug MIPS: Remove compact branch policy Kconfig entries 2016-09-30 10:18:39 +02:00
Makefile MIPS: Remove compact branch policy Kconfig entries 2016-09-30 10:18:39 +02:00