]> 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)
commitdcc3f0a51a1e2097fcfb2830bb2b361717aca947
tree3d5afb5530e76ef0d3dceb804f0b1909b49702fa
parentbc5e9e7a4d6530583bc42ed5fcd2aa207fcb761e
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