linux/arch/powerpc
Alexey Kardashevskiy a0a4d7a23d KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots
[ Upstream commit 511d25d6b7 ]

The userspace can trigger "vmalloc size %lu allocation failure: exceeds
total pages" via the KVM_SET_USER_MEMORY_REGION ioctl.

This silences the warning by checking the limit before calling vzalloc()
and returns ENOMEM if failed.

This does not call underlying valloc helpers as __vmalloc_node() is only
exported when CONFIG_TEST_VMALLOC_MODULE and __vmalloc_node_range() is
not exported at all.

Spotted by syzkaller.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[mpe: Use 'size' for the variable rather than 'cb']
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210901084512.1658628-1-aik@ozlabs.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 11:04:58 +01:00
..
boot powerpc/5200: dts: fix memory node unit name 2021-11-25 09:48:30 +01:00
configs powerpc/configs/microwatt: Enable options for systemd 2021-08-27 00:56:53 +10:00
crypto crypto: powepc/sha1 - remove unneeded semicolon 2021-03-07 15:13:14 +11:00
include powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC 2022-01-27 11:04:07 +01:00
kernel powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING 2022-01-27 11:04:58 +01:00
kexec powerpc updates for 5.15 2021-09-03 11:22:50 -07:00
kvm KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots 2022-01-27 11:04:58 +01:00
lib powerpc/security: Use a mutex for interrupt exit code patching 2021-11-18 19:17:19 +01:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm powerpc/32s: Fix shift-out-of-bounds in KASAN init 2022-01-27 11:04:08 +01:00
net powerpc/bpf: Fix write protecting JIT code 2021-11-18 19:17:19 +01:00
perf powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC 2022-01-27 11:04:07 +01:00
platforms powerpc/powermac: Add missing lockdep_register_key() 2022-01-27 11:04:58 +01:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc/xive: Add missing null check after calling kmalloc 2022-01-27 11:04:18 +01:00
tools powerpc/head_check: Fix shellcheck errors 2021-08-17 22:52:02 +10:00
xmon powerpc/xmon: fix task state output 2021-11-18 19:16:57 +01:00
Kbuild
Kconfig powerpc/booke: Disable STRICT_KERNEL_RWX, DEBUG_PAGEALLOC and KFENCE 2021-11-18 19:16:54 +01:00
Kconfig.debug powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Makefile powerpc: Add "-z notext" flag to disable diagnostic 2021-08-15 13:49:39 +10:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00