]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: s390: Fix skey emulation permission check
authorJanosch Frank <frankja@linux.vnet.ibm.com>
Mon, 4 Dec 2017 11:19:11 +0000 (12:19 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 6 Dec 2017 08:18:43 +0000 (09:18 +0100)
commitd76eea665b939285d90ab74322dc5368e8079372
tree9b18cd3ec7dd03b175d91a715b70d150b903cc54
parent5ef0ff8261a34b820b922ac37f4e2e34730ffb7a
KVM: s390: Fix skey emulation permission check

All skey functions call skey_check_enable at their start, which checks
if we are in the PSTATE and injects a privileged operation exception
if we are.

Unfortunately they continue processing afterwards and perform the
operation anyhow as skey_check_enable does not deliver an error if the
exception injection was successful.

Let's move the PSTATE check into the skey functions and exit them on
such an occasion, also we now do not enable skey handling anymore in
such a case.

Signed-off-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Fixes: 8d7f364 ("KVM: s390: handle missing storage-key facility")
Cc: <stable@vger.kernel.org> # v4.8+
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/priv.c