aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-sub-ui.c
diff options
context:
space:
mode:
authorMichael Ellerman <[email protected]>2022-07-28 00:32:17 +1000
committerMichael Ellerman <[email protected]>2022-07-28 16:22:15 +1000
commit90b5d4fe0b3ba7f589c6723c6bfb559d9e83956a (patch)
treefd415104a208db7f82c02386962ae6589b36c626 /lib/mpi/mpi-sub-ui.c
parentcd1e64935f79e31d666172c52c951ca97152b783 (diff)
powerpc/powernv: Avoid crashing if rng is NULL
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: e928e9cb3601 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.") Cc: [email protected] # v4.1+ Signed-off-by: Jason A. Donenfeld <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/mpi/mpi-sub-ui.c')
0 files changed, 0 insertions, 0 deletions