Re: KASAN: out-of-bounds Write in nested_sync_vmcs12_to_shadow

From: Paolo Bonzini
Date: Tue Apr 21 2020 - 09:38:46 EST


On 21/04/20 02:15, syzbot wrote:
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+6ad11779184a3afe9f7e@xxxxxxxxxxxxxxxxxxxxxxxxx
>
> ==================================================================
> BUG: KASAN: out-of-bounds in copy_vmcs12_to_enlightened arch/x86/kvm/vmx/nested.c:1820 [inline]
> BUG: KASAN: out-of-bounds in nested_sync_vmcs12_to_shadow+0x49e3/0x4a60 arch/x86/kvm/vmx/nested.c:2000
> Write of size 2 at addr ffffc90004db72e8 by task syz-executor.4/8294
>
> CPU: 1 PID: 8294 Comm: syz-executor.4 Not tainted 5.7.0-rc1-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Call Trace:
> <IRQ>
> __dump_stack lib/dump_stack.c:77 [inline]
> dump_stack+0x188/0x20d lib/dump_stack.c:118
> print_address_description.constprop.0.cold+0x5/0x315 mm/kasan/report.c:382
> __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511
> kasan_report+0x33/0x50 mm/kasan/common.c:625
> copy_vmcs12_to_enlightened arch/x86/kvm/vmx/nested.c:1820 [inline]
> nested_sync_vmcs12_to_shadow+0x49e3/0x4a60 arch/x86/kvm/vmx/nested.c:2000
> </IRQ>

That's a weird stack trace for a reproducer that is doing operations on
/dev/fb0. What's going on?

Paolo