From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>,
Gleb Natapov <gleb@kernel.org>,
nadav.amit@gmail.com
Subject: Re: [PATCH] kvm: x86: i8259: return initialized data on invalid-size read
Date: Thu, 12 Mar 2015 22:02:59 -0300 [thread overview]
Message-ID: <20150313010259.GB17648@amt.cnet> (raw)
In-Reply-To: <20150311111609.GG8544@dhcp-25-225.brq.redhat.com>
On Wed, Mar 11, 2015 at 12:16:09PM +0100, Petr Matousek wrote:
> If data is read from PIC with invalid access size, the return data stays
> uninitialized even though success is returned.
>
> Fix this by always initializing the data.
>
> Signed-off-by: Petr Matousek <pmatouse@redhat.com>
> Reported-by: Nadav Amit <nadav.amit@gmail.com>
> ---
> arch/x86/kvm/i8259.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
> index cc31f7c..9541ba3 100644
> --- a/arch/x86/kvm/i8259.c
> +++ b/arch/x86/kvm/i8259.c
> @@ -507,6 +507,7 @@ static int picdev_read(struct kvm_pic *s,
> return -EOPNOTSUPP;
>
> if (len != 1) {
> + memset(val, 0, len);
> pr_pic_unimpl("non byte read\n");
> return 0;
> }
> --
> 1.7.4.4
Applied, thanks.
next prev parent reply other threads:[~2015-03-13 1:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 11:16 [PATCH] kvm: x86: i8259: return initialized data on invalid-size read Petr Matousek
2015-03-13 1:02 ` Marcelo Tosatti [this message]
2015-03-30 14:40 ` Paolo Bonzini
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=20150313010259.GB17648@amt.cnet \
--to=mtosatti@redhat.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=nadav.amit@gmail.com \
--cc=pbonzini@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox