diff options
author | Christoph Schlameuss <[email protected]> | 2024-12-16 10:21:37 +0100 |
---|---|---|
committer | Claudio Imbrenda <[email protected]> | 2025-01-07 16:36:11 +0100 |
commit | 5021fd77d68fce28048b1af18c87bad6b7ffb282 (patch) | |
tree | 9a3c503ade1acaeba988fdc575cc89ed54edf13c /arch/s390/kvm/interrupt.c | |
parent | b07f6a30c7a42661ce7c0222a642c8e91d69c8b1 (diff) |
KVM: s390: Reject KVM_SET_GSI_ROUTING on ucontrol VMs
Prevent null pointer dereference when processing
KVM_IRQ_ROUTING_S390_ADAPTER routing entries.
The ioctl cannot be processed for ucontrol VMs.
Fixes: f65470661f36 ("KVM: s390/interrupt: do not pin adapter interrupt pages")
Signed-off-by: Christoph Schlameuss <[email protected]>
Tested-by: Hariharan Mari <[email protected]>
Reviewed-by: Hariharan Mari <[email protected]>
Reviewed-by: Claudio Imbrenda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Message-ID: <[email protected]>
Signed-off-by: Claudio Imbrenda <[email protected]>
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r-- | arch/s390/kvm/interrupt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 22d73c13e555..d4f031e086fc 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -2898,6 +2898,8 @@ int kvm_set_routing_entry(struct kvm *kvm, switch (ue->type) { /* we store the userspace addresses instead of the guest addresses */ case KVM_IRQ_ROUTING_S390_ADAPTER: + if (kvm_is_ucontrol(kvm)) + return -EINVAL; e->set = set_adapter_int; uaddr = gmap_translate(kvm->arch.gmap, ue->u.adapter.summary_addr); if (uaddr == -EFAULT) |