OrangePi_CM5/arch/powerpc/platforms
Michael Ellerman 26d767990e powerpc/powernv: Avoid crashing if rng is NULL
commit 90b5d4fe0b3ba7f589c6723c6bfb559d9e83956a upstream.

On a bare-metal Power8 system that doesn't have an "ibm,power-rng", a
malicious QEMU and guest that ignore the absence of the
KVM_CAP_PPC_HWRNG flag, and calls H_RANDOM anyway, will dereference a
NULL pointer.

In practice all Power8 machines have an "ibm,power-rng", but let's not
rely on that, add a NULL check and early return in
powernv_get_random_real_mode().

Fixes: e928e9cb36 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.")
Cc: stable@vger.kernel.org # v4.1+
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220727143219.2684192-1-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-21 15:15:26 +02:00
..
4xx powerpc/4xx/cpm: Fix return value of __setup() handler 2022-06-09 10:21:16 +02:00
8xx powerpc/8xx: export 'cpm_setbrg' for modules 2022-06-09 10:21:16 +02:00
40x
…
44x powerpc/44x/fsp2: add missing of_node_put 2021-11-18 14:04:21 +01:00
52xx powerpc/52xx: Fix an invalid ASM expression ('addi' used instead of 'add') 2021-05-14 09:50:42 +02:00
82xx
…
83xx
…
85xx powerpc/85xx: Fix oops when CONFIG_FSL_PMC=n 2021-12-22 09:30:56 +01:00
86xx
…
512x
…
amigaone
…
cell powerpc/cell: Fix clang -Wimplicit-fallthrough warning 2022-01-27 10:54:30 +01:00
chrp
…
embedded6xx powerpc/6xx: add missing of_node_put 2022-01-27 10:54:21 +01:00
maple
…
pasemi
…
powermac powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:32:46 +02:00
powernv powerpc/powernv: Avoid crashing if rng is NULL 2022-08-21 15:15:26 +02:00
ps3 powerpc/ps3: Add dma_mask to ps3_dma_region 2021-07-20 16:05:42 +02:00
pseries powerpc/pseries: wire up rng during setup_arch() 2022-06-29 08:59:54 +02:00
Kconfig
…
Kconfig.cputype
…
Makefile
…
fsl_uli1575.c
…