summaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-08-22 14:34:11 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2012-08-26 15:11:48 -0300
commit760a9a30adc558a75916a13902f38c6792fa8c4b (patch)
treea6a061b4f621845a8c3f762c518e557b56b27689 /virt/kvm
parent9acb172543aecb783e2e1e53e3f447d4c0f5c150 (diff)
downloadlinux-760a9a30adc558a75916a13902f38c6792fa8c4b.tar.gz
linux-760a9a30adc558a75916a13902f38c6792fa8c4b.tar.bz2
linux-760a9a30adc558a75916a13902f38c6792fa8c4b.zip
kvm: Fix nonsense handling of compat ioctl
KVM_SET_SIGNAL_MASK passed a NULL argument leaves the on stack signal sets uninitialized. It then passes them through to kvm_vcpu_ioctl_set_sigmask. We should be passing a NULL in this case not translated garbage. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/kvm_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 246852397e30..d617f69131d7 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1976,9 +1976,10 @@ static long kvm_vcpu_compat_ioctl(struct file *filp,
if (copy_from_user(&csigset, sigmask_arg->sigset,
sizeof csigset))
goto out;
- }
- sigset_from_compat(&sigset, &csigset);
- r = kvm_vcpu_ioctl_set_sigmask(vcpu, &sigset);
+ sigset_from_compat(&sigset, &csigset);
+ r = kvm_vcpu_ioctl_set_sigmask(vcpu, &sigset);
+ } else
+ r = kvm_vcpu_ioctl_set_sigmask(vcpu, NULL);
break;
}
default: