Skip to contentSkip to conversation

KVM: Fix off-by-one in overflow check of KVM_ASSIGN_SET_MSIX_NR

PATCH Applied Jan Kiszka 2 participants 2 messages Jun 11, 2011 – Jun 13, 2011 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 KVM: Fix off-by-one in overflow check of KVM_ASSIGN_SET_MSIX_NR

From: Jan Kiszka <[email protected]>

KVM_MAX_MSIX_PER_DEV implies that up to that many MSI-X entries can be requested. But the kernel so far rejected already the upper limit.

---
 virt/kvm/assigned-dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
virt/kvm/assigned-dev.c +1 -1
index 6cc4b97..4e9eaeb 100644
@@ -617,7 +617,7 @@ static int kvm_vm_ioctl_set_msix_nr(struct kvm *kvm,
 	if (adev->entries_nr == 0) {
 		adev->entries_nr = entry_nr->entry_nr;
 		if (adev->entries_nr == 0 ||
-		    adev->entries_nr >= KVM_MAX_MSIX_PER_DEV) {
+		    adev->entries_nr > KVM_MAX_MSIX_PER_DEV) {
 			r = -EINVAL;
 			goto msix_nr_out;
 		}
Signature · 1 line
1.7.1
Applied
#1 lore raw
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

KVM_MAX_MSIX_PER_DEV implies that up to that many MSI-X entries can be requested. But the kernel so far rejected already the upper limit.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function