]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Fix radix guest SLB side channel
authorNicholas Piggin <npiggin@gmail.com>
Mon, 18 Jan 2021 06:28:07 +0000 (16:28 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Wed, 10 Feb 2021 03:31:08 +0000 (14:31 +1100)
commitd9fcbcdeee406cdcf2fd421f05c3d68e7d4eed82
tree3d5afb5530e76ef0d3dceb804f0b1909b49702fa
parent2270cc6037596fee8c3d6db770afe4832dd2afb3
KVM: PPC: Book3S HV: Fix radix guest SLB side channel

The slbmte instruction is legal in radix mode, including radix guest
mode. This means radix guests can load the SLB with arbitrary data.

KVM host does not clear the SLB when exiting a guest if it was a
radix guest, which would allow a rogue radix guest to use the SLB as
a side channel to communicate with other guests.

Fix this by ensuring the SLB is cleared when coming out of a radix
guest. Only the first 4 entries are a concern, because radix guests
always run with LPCR[UPRT]=1, which limits the reach of slbmte. slbia
is not used (except in a non-performance-critical path) because it
can clear cached translations.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_hv_rmhandlers.S