KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls
authorLaurent Dufour <ldufour@linux.ibm.com>
Fri, 20 Mar 2020 10:26:42 +0000 (11:26 +0100)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 24 Mar 2020 02:08:51 +0000 (13:08 +1100)
commit8c47b6ff29e3d88484fe59d02f9db6de7e44e310
treede9517b28acd05a630c476a8205fc5c1afee66ae
parent9bee484b280a059c1faa10ae174af4f4af02c805
KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls

The Hcall named H_SVM_* are reserved to the Ultravisor. However, nothing
prevent a malicious VM or SVM to call them. This could lead to weird result
and should be filtered out.

Checking the Secure bit of the calling MSR ensure that the call is coming
from either the Ultravisor or a SVM. But any system call made from a SVM
are going through the Ultravisor, and the Ultravisor should filter out
these malicious call. This way, only the Ultravisor is able to make such a
Hcall.

Cc: Bharata B Rao <bharata@linux.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Ram Pai <linuxram@us.ibnm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_hv.c