================================================================== BUG: KASAN: use-after-free in mon_bin_vma_fault+0x378/0x400 drivers/usb/mon/mon_bin.c:1238 Read of size 8 at addr ffff8801cb81a0c0 by task syz-executor6/8066 CPU: 1 PID: 8066 Comm: syz-executor6 Not tainted 4.15.0-rc6-mm1+ #52 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23b/0x360 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 mon_bin_vma_fault+0x378/0x400 drivers/usb/mon/mon_bin.c:1238 __do_fault+0xeb/0x30f mm/memory.c:3224 do_read_fault mm/memory.c:3634 [inline] do_fault mm/memory.c:3734 [inline] handle_pte_fault mm/memory.c:3965 [inline] __handle_mm_fault+0x1d8f/0x3ce0 mm/memory.c:4089 handle_mm_fault+0x38f/0x930 mm/memory.c:4126 faultin_page mm/gup.c:502 [inline] __get_user_pages+0x50c/0x15f0 mm/gup.c:699 populate_vma_page_range+0x20e/0x2f0 mm/gup.c:1200 __mm_populate+0x23a/0x450 mm/gup.c:1250 mm_populate include/linux/mm.h:2233 [inline] vm_mmap_pgoff+0x241/0x280 mm/util.c:338 SYSC_mmap_pgoff mm/mmap.c:1544 [inline] SyS_mmap_pgoff+0x462/0x5f0 mm/mmap.c:1502 SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91 entry_SYSCALL_64_fastpath+0x23/0x9a RIP: 0033:0x452ac9 RSP: 002b:00007f1067b0dc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9 RDX: 0000000001000004 RSI: 0000000000004000 RDI: 0000000020ac6000 RBP: 00000000000003eb R08: 0000000000000016 R09: 0000000000000000 R10: 0000000000008011 R11: 0000000000000212 R12: 00000000006f3ea8 R13: 00000000ffffffff R14: 00007f1067b0e6d4 R15: 0000000000000000 Allocated by task 8066: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3607 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:704 [inline] mon_bin_open+0x1ae/0x4a0 drivers/usb/mon/mon_bin.c:703 chrdev_open+0x257/0x730 fs/char_dev.c:417 do_dentry_open+0x667/0xd40 fs/open.c:752 vfs_open+0x107/0x220 fs/open.c:866 do_last fs/namei.c:3397 [inline] path_openat+0x1151/0x3530 fs/namei.c:3537 do_filp_open+0x25b/0x3b0 fs/namei.c:3572 do_sys_open+0x502/0x6d0 fs/open.c:1059 SYSC_open fs/open.c:1077 [inline] SyS_open+0x2d/0x40 fs/open.c:1072 entry_SYSCALL_64_fastpath+0x23/0x9a Freed by task 8077: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3485 [inline] kfree+0xd9/0x260 mm/slab.c:3800 mon_bin_ioctl+0x68d/0xd40 drivers/usb/mon/mon_bin.c:1040 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x23/0x9a The buggy address belongs to the object at ffff8801cb81a0c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff8801cb81a0c0, ffff8801cb81a8c0) The buggy address belongs to the page: page:ffffea00072e0680 count:1 mapcount:0 mapping:ffff8801cb81a0c0 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801cb81a0c0 0000000000000000 0000000100000003 raw: ffffea0007341720 ffffea000731ffa0 ffff8801dac00c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cb819f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801cb81a000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801cb81a080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8801cb81a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801cb81a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================