Skip to content

Commit

Permalink
kvm: Fix nonsense handling of compat ioctl
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
Alan Cox authored and matosatti committed Aug 26, 2012
1 parent 9acb172 commit 760a9a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 760a9a3

Please sign in to comment.