mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <kernellwp@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
	"Wanpeng Li" <wanpeng.li@hotmail.com>,
	"Christoffer Dall" <christoffer.dall@linaro.org>
Subject: Re: [PATCH v4] KVM: Fix stack-out-of-bounds read in write_mmio
Date: Mon, 18 Dec 2017 12:06:09 +0000	[thread overview]
Message-ID: <853e8b51-ff54-a48d-8ce8-17060152382b@arm.com> (raw)
In-Reply-To: <17d27b8d-908b-a740-1d2d-e92a8507f25b@redhat.com>

On 18/12/17 11:55, Paolo Bonzini wrote:
> On 15/12/2017 12:06, Marc Zyngier wrote:
>> Assuming you address the above:
>>
>> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
>> Tested-by: Marc Zyngier <marc.zyngier@arm.com>
> 
> Done as follows:
> 
> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
> index dfd21708694f..0a016bd14c2d 100644
> --- a/include/trace/events/kvm.h
> +++ b/include/trace/events/kvm.h
> @@ -227,7 +227,8 @@
>  		__entry->gpa		= gpa;
>  		__entry->val = 0;
>  		if (val)
> -			memcpy(&__entry->val, val, min(8, len));
> +			memcpy(&__entry->val, val,
> +			       min_t(u32, sizeof(__entry->val), len));
>  	),
>  
>  	TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx",
> 

Looks good to me.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2017-12-18 12:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15  1:40 Wanpeng Li
2017-12-15  9:52 ` Darren Kenny
2017-12-15 11:06 ` Marc Zyngier
2017-12-17  2:10   ` Wanpeng Li
2017-12-18 11:55   ` Paolo Bonzini
2017-12-18 12:06     ` Marc Zyngier [this message]
2017-12-18 12:09     ` Wanpeng Li

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=853e8b51-ff54-a48d-8ce8-17060152382b@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=wanpeng.li@hotmail.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

all inboxes | Powered by JetHome®