syzbot


KASAN: slab-out-of-bounds Read in handle_vmptrld

Status: auto-obsoleted due to no activity on 2022/09/08 23:04
Subsystems: kvm
[Documentation on labels]
Reported-by: syzbot+46f1dd7dbbe2bfb98b10@syzkaller.appspotmail.com
First crash: 1654d, last: 1650d
Cause bisection: introduced by (bisect log) :
commit a87f854ddcf7ff7e044d72db0aa6da82f26d69a6
Author: Neil Armstrong <narmstrong@baylibre.com>
Date: Wed Oct 11 15:39:40 2017 +0000

  ARM64: dts: meson-gx: remove unnecessary uart compatible

Crash: WARNING in __x86_set_memory_region (log)
Repro: C syz .config
  
Fix bisection: failed (error log, bisect log)
  
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
kernel BUG at arch/x86/kvm/mmu.c:LINE! (2) kvm C done 5 1588d 1592d 0/26 closed as dup on 2019/11/08 19:42
Discussions (3)
Title Replies (including bot) Last reply
Reminder: 45 active syzbot reports in usb subsystem 1 (1) 2019/11/19 04:27
KASAN: slab-out-of-bounds Read in handle_vmptrld 12 (13) 2019/10/21 15:47
Reminder: 52 active syzbot reports in usb subsystem 4 (4) 2019/09/19 19:01
Last patch testing requests (5)
Created Duration User Patch Repo Result
2022/09/08 20:27 16m retest repro upstream OK log
2022/09/06 21:27 16m retest repro upstream OK log
2022/09/05 22:27 16m retest repro upstream OK log
2022/09/03 12:27 16m retest repro upstream OK log
2022/09/03 08:27 15m retest repro upstream OK log

Sample crash report:
L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details.
==================================================================
BUG: KASAN: slab-out-of-bounds in handle_vmptrld arch/x86/kvm/vmx/nested.c:4789 [inline]
BUG: KASAN: slab-out-of-bounds in handle_vmptrld+0x777/0x800 arch/x86/kvm/vmx/nested.c:4749
Read of size 4 at addr ffff888091f78000 by task syz-executor571/9898

CPU: 0 PID: 9898 Comm: syz-executor571 Not tainted 5.3.0-rc8+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351
 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482
 kasan_report+0x12/0x17 mm/kasan/common.c:618
 __asan_report_load_n_noabort+0xf/0x20 mm/kasan/generic_report.c:142
 handle_vmptrld arch/x86/kvm/vmx/nested.c:4789 [inline]
 handle_vmptrld+0x777/0x800 arch/x86/kvm/vmx/nested.c:4749
 vmx_handle_exit+0x299/0x15e0 arch/x86/kvm/vmx/vmx.c:5886
 vcpu_enter_guest+0x1087/0x5e90 arch/x86/kvm/x86.c:8088
 vcpu_run arch/x86/kvm/x86.c:8152 [inline]
 kvm_arch_vcpu_ioctl_run+0x464/0x1750 arch/x86/kvm/x86.c:8360
 kvm_vcpu_ioctl+0x4dc/0xfd0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2765
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:509 [inline]
 do_vfs_ioctl+0xdb6/0x13e0 fs/ioctl.c:696
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl fs/ioctl.c:718 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x447269
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 3b d0 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffe14398788 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffe14398790 RCX: 0000000000447269
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000020003800 R09: 0000000000400e80
R10: 00007ffe14396bd0 R11: 0000000000000246 R12: 0000000000404730
R13: 00000000004047c0 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 9898:
 save_stack+0x23/0x90 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 __kasan_kmalloc mm/kasan/common.c:493 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:466
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:507
 __do_kmalloc mm/slab.c:3655 [inline]
 __kmalloc+0x163/0x770 mm/slab.c:3664
 kmalloc include/linux/slab.h:557 [inline]
 hcd_buffer_alloc+0x1c6/0x260 drivers/usb/core/buffer.c:132
 usb_alloc_coherent+0x62/0x90 drivers/usb/core/usb.c:910
 usbdev_mmap+0x1ce/0x790 drivers/usb/core/devio.c:224
 call_mmap include/linux/fs.h:1875 [inline]
 mmap_region+0xc35/0x1760 mm/mmap.c:1788
 do_mmap+0x82e/0x1090 mm/mmap.c:1561
 do_mmap_pgoff include/linux/mm.h:2374 [inline]
 vm_mmap_pgoff+0x1c5/0x230 mm/util.c:391
 ksys_mmap_pgoff+0x4aa/0x630 mm/mmap.c:1611
 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline]
 __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline]
 __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 9422:
 save_stack+0x23/0x90 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463
 __cache_free mm/slab.c:3425 [inline]
 kfree+0x10a/0x2c0 mm/slab.c:3756
 tomoyo_init_log+0x15ba/0x2070 security/tomoyo/audit.c:293
 tomoyo_supervisor+0x33f/0xef0 security/tomoyo/common.c:2095
 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline]
 tomoyo_env_perm+0x18e/0x210 security/tomoyo/environ.c:63
 tomoyo_environ security/tomoyo/domain.c:670 [inline]
 tomoyo_find_next_domain+0x1354/0x1f6c security/tomoyo/domain.c:876
 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:107 [inline]
 tomoyo_bprm_check_security+0x124/0x1b0 security/tomoyo/tomoyo.c:97
 security_bprm_check+0x63/0xb0 security/security.c:750
 search_binary_handler+0x71/0x570 fs/exec.c:1645
 exec_binprm fs/exec.c:1701 [inline]
 __do_execve_file.isra.0+0x1333/0x2340 fs/exec.c:1821
 do_execveat_common fs/exec.c:1868 [inline]
 do_execve fs/exec.c:1885 [inline]
 __do_sys_execve fs/exec.c:1961 [inline]
 __se_sys_execve fs/exec.c:1956 [inline]
 __x64_sys_execve+0x8f/0xc0 fs/exec.c:1956
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff888091f78b80
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2944 bytes to the left of
 8192-byte region [ffff888091f78b80, ffff888091f7ab80)
The buggy address belongs to the page:
page:ffffea000247de00 refcount:2 mapcount:0 mapping:ffff8880aa4021c0 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0002277008 ffffea0002339008 ffff8880aa4021c0
raw: 0000000000000000 ffff888091f78b80 0000000200000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888091f77f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888091f77f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888091f78000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff888091f78080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888091f78100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/09/12 01:27 upstream 3120b9a6a3f7 f4e53c10 .config console log report syz C ci-upstream-kasan-gce-root
2019/09/11 18:16 upstream 3120b9a6a3f7 a60cb4cd .config console log report syz C ci-upstream-kasan-gce
2019/09/10 19:20 upstream 3120b9a6a3f7 a60cb4cd .config console log report syz C ci-upstream-kasan-gce-smack-root
2019/09/10 14:24 upstream 3120b9a6a3f7 a60cb4cd .config console log report syz C ci-upstream-kasan-gce-selinux-root
2019/09/07 19:32 upstream 1e3778cb223e a60cb4cd .config console log report syz C ci-upstream-kasan-gce
2019/09/07 18:58 upstream 1e3778cb223e a60cb4cd .config console log report ci-upstream-kasan-gce
* Struck through repros no longer work on HEAD.