From: Avi Kivity <avi@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] kvm: Fix nonsense handling of compat ioctl
Date: Wed, 22 Aug 2012 15:22:44 +0300 [thread overview]
Message-ID: <5034CF14.5020909@redhat.com> (raw)
In-Reply-To: <20120820144330.6218.27112.stgit@localhost.localdomain>
On 08/20/2012 05:43 PM, 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>
> ---
>
> 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..e47a7ca 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
> + kvm_vcpu_ioctl_set_sigmask(vcpu, NULL);
> break;
> }
Now r is uninitiali[sz]ed.
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2012-08-22 12:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-20 14:43 [PATCH RESEND] kvm: Fix nonsense handling of compat ioctl Alan Cox
2012-08-22 12:22 ` Avi Kivity [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5034CF14.5020909@redhat.com \
--to=avi@redhat.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.