diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-01-08 08:09:57 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-01-08 08:09:57 -0500 |
commit | fb872da8e720f8281dde01b8929419eb5ae6b033 (patch) | |
tree | ebd9be9500f7cfd550fcae98a321f66abdc3d944 /virt | |
parent | 5f53d88f10eb07de0a9bf50e6ad21982e48fd3e3 (diff) | |
parent | 1f829359c8c37f77a340575957686ca8c4bca317 (diff) |
Merge tag 'kvm-x86-generic-6.8' of https://github.com/kvm-x86/linux into HEAD
Common KVM changes for 6.8:
- Use memdup_array_user() to harden against overflow.
- Unconditionally advertise KVM_CAP_DEVICE_CTRL for all architectures.
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8d59f83458ca..10bfc88a69f7 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -4867,6 +4867,7 @@ static int kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) #endif case KVM_CAP_BINARY_STATS_FD: case KVM_CAP_SYSTEM_EVENT_DATA: + case KVM_CAP_DEVICE_CTRL: return 1; #ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES case KVM_CAP_MEMORY_ATTRIBUTES: @@ -5256,9 +5257,8 @@ static long kvm_vm_ioctl(struct file *filp, goto out; if (routing.nr) { urouting = argp; - entries = vmemdup_user(urouting->entries, - array_size(sizeof(*entries), - routing.nr)); + entries = vmemdup_array_user(urouting->entries, + routing.nr, sizeof(*entries)); if (IS_ERR(entries)) { r = PTR_ERR(entries); goto out; |