* [PATCHv2] kvm: Fix nonsense handling of compat ioctl
@ 2012-08-22 13:34 Alan Cox
2012-08-26 18:12 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2012-08-22 13:34 UTC (permalink / raw)
To: kvm, linux-kernel
From: Alan Cox <alan@linux.intel.com>
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>
---
virt/kvm/kvm_main.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index a2e85af..cd1fde9a 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1975,9 +1975,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:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCHv2] kvm: Fix nonsense handling of compat ioctl
2012-08-22 13:34 [PATCHv2] kvm: Fix nonsense handling of compat ioctl Alan Cox
@ 2012-08-26 18:12 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2012-08-26 18:12 UTC (permalink / raw)
To: Alan Cox; +Cc: kvm, linux-kernel
On Wed, Aug 22, 2012 at 02:34:11PM +0100, Alan Cox wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-26 18:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22 13:34 [PATCHv2] kvm: Fix nonsense handling of compat ioctl Alan Cox
2012-08-26 18:12 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox