diff options
author | Radim Krčmář | 2016-10-20 20:31:01 +0200 |
---|---|---|
committer | Radim Krčmář | 2016-10-20 20:31:01 +0200 |
commit | 3633031db5bcc87f5b7d9938c4f94bc8f178c51f (patch) | |
tree | c810ccaa1a0dfbf757fa58d243b649906ee8c679 | |
parent | f6bbf1b7ac1fba284df82d7344080a8e7435b023 (diff) | |
parent | a5efb6b6c99a3a6dc4330f51d8066f638bdea0ac (diff) |
Merge tag 'kvm-s390-master-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux
KVM: s390: Fix for user-triggerable WARN_ON
A malicious user space can provide an invalid mode for runtime
instrumentation via the interfaces that are normally used on
the target host during migration. This would trigger a WARN_ON
via validity intercept. Let's detect this special case.
-rw-r--r-- | arch/s390/kvm/intercept.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index 1cab8a177d0e..7a27eebab28a 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c @@ -119,8 +119,13 @@ static int handle_validity(struct kvm_vcpu *vcpu) vcpu->stat.exit_validity++; trace_kvm_s390_intercept_validity(vcpu, viwhy); - WARN_ONCE(true, "kvm: unhandled validity intercept 0x%x\n", viwhy); - return -EOPNOTSUPP; + KVM_EVENT(3, "validity intercept 0x%x for pid %u (kvm 0x%pK)", viwhy, + current->pid, vcpu->kvm); + + /* do not warn on invalid runtime instrumentation mode */ + WARN_ONCE(viwhy != 0x44, "kvm: unhandled validity intercept 0x%x\n", + viwhy); + return -EINVAL; } static int handle_instruction(struct kvm_vcpu *vcpu) |