lkml.org 
[lkml]   [2017]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4] KVM: Fix stack-out-of-bounds read in write_mmio
2017-12-18 19:55 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
> 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",

Thanks Paolo. :)

Regards,
Wanpeng Li

\
 
 \ /
  Last update: 2017-12-18 13:11    [W:0.060 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site