All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: kvm <kvm@vger.kernel.org>, Marcelo Tosatti <mtosatti@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: Mon, 30 Mar 2015 16:40:16 +0200	[thread overview]
Message-ID: <55196050.1090306@redhat.com> (raw)
In-Reply-To: <20150311111609.GG8544@dhcp-25-225.brq.redhat.com>



On 11/03/2015 12:16, 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;
>  	}
> 

Applied, thanks.

Paolo

      parent reply	other threads:[~2015-03-30 14:40 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
2015-03-30 14:40 ` Paolo Bonzini [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=55196050.1090306@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=nadav.amit@gmail.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 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.