qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Stefan Weil <sw@weilnetz.de>, Anthony Liguori <aliguori@us.ibm.com>
Cc: "Jim Meyering" <meyering@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Avi Kivity" <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1.1 1/2] kvm/apic: correct short memset
Date: Wed, 23 May 2012 07:33:10 -0300	[thread overview]
Message-ID: <4FBCBCE6.3060000@siemens.com> (raw)
In-Reply-To: <4FBBF762.3070009@weilnetz.de>

On 2012-05-22 17:30, Stefan Weil wrote:
> Am 10.05.2012 19:28, schrieb Jan Kiszka:
>> On 2012-05-10 13:19, Jim Meyering wrote:
>>    
>>> From: Jim Meyering<meyering@redhat.com>
>>>
>>> kvm_put_apic_state's attempt to clear *kapic before setting its
>>> bits cleared sizeof(void*) bytes (no more than 8) rather than the
>>> intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity.
>>>
>>> Signed-off-by: Jim Meyering<meyering@redhat.com>
>>> ---
>>>   hw/kvm/apic.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c
>>> index ffe7a52..a0ab503 100644
>>> --- a/hw/kvm/apic.c
>>> +++ b/hw/kvm/apic.c
>>> @@ -29,7 +29,7 @@ void kvm_put_apic_state(DeviceState *d, struct kvm_lapic_state *kapic)
>>>       APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
>>>       int i;
>>>
>>> -    memset(kapic, 0, sizeof(kapic));
>>> +    memset(kapic, 0, sizeof(*kapic));
>>>       kvm_apic_set_reg(kapic, 0x2, s->id<<  24);
>>>       kvm_apic_set_reg(kapic, 0x8, s->tpr);
>>>       kvm_apic_set_reg(kapic, 0xd, s->log_dest<<  24);
>>>      
>> Yep, that's what I actually meant...
>>
>> Thanks,
>> Jan
>>
>>    
> 
> Reviewed-by: Stefan Weil <sw@weilnetz.de>
> 
> Hello Anthony,
> 
> this patch should be committed to QEMU 1.1.
> I had sent a patch with the same fix 6 days later.

Thanks for reminding. Yes, please merge!

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2012-05-23 10:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 16:19 [Qemu-devel] [PATCH 0/2] memset/sizeof abuse Jim Meyering
2012-05-10 16:19 ` [Qemu-devel] [PATCH 1/2] kvm/apic: correct short memset Jim Meyering
2012-05-10 17:28   ` Jan Kiszka
2012-05-22 20:30     ` [Qemu-devel] [PATCH 1.1 " Stefan Weil
2012-05-23 10:33       ` Jan Kiszka [this message]
2012-06-10 20:29         ` Stefan Weil
2012-06-11  5:29           ` Jan Kiszka
2012-06-11  9:58   ` [Qemu-devel] [PATCH " Avi Kivity
2012-05-10 16:19 ` [Qemu-devel] [PATCH 2/2] cadence_gem: avoid stack-writing buffer-overrun Jim Meyering
2012-05-14  4:57   ` Peter Crosthwaite
2012-06-10 20:34     ` Stefan Weil

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=4FBCBCE6.3060000@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=meyering@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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;
as well as URLs for NNTP newsgroup(s).