kauditd_printk_skb: 396 callbacks suppressed audit: type=1400 audit(1514758222.545:1546): avc: denied { map } for pid=12957 comm="syz-executor6" path="/dev/usbmon0" dev="devtmpfs" ino=8897 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usbmon_device_t:s0 tclass=chr_file permissive=1 ================================================================== 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 ffff8801c06dc140 by task syz-executor6/12980 CPU: 1 PID: 12980 Comm: syz-executor6 Not tainted 4.15.0-rc4-mm1+ #49 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:355 [inline] kasan_report+0x23b/0x360 mm/kasan/report.c:413 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:434 mon_bin_vma_fault+0x378/0x400 drivers/usb/mon/mon_bin.c:1238 __do_fault+0xeb/0x30f mm/memory.c:3206 do_read_fault mm/memory.c:3616 [inline] do_fault mm/memory.c:3716 [inline] handle_pte_fault mm/memory.c:3947 [inline] __handle_mm_fault+0x1d8f/0x3ce0 mm/memory.c:4071 handle_mm_fault+0x38f/0x930 mm/memory.c:4108 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+0x1f/0x96 RIP: 0033:0x452ac9 RSP: 002b:00007f45e5988c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 000000000071bf58 RCX: 0000000000452ac9 RDX: 0000000001000004 RSI: 0000000000004000 RDI: 0000000020ac6000 RBP: 00000000000005d1 R08: 0000000000000015 R09: 0000000000000000 R10: 0000000000008011 R11: 0000000000000212 R12: 00000000006f6c38 R13: 00000000ffffffff R14: 00007f45e59896d4 R15: 0000000000000002 Allocated by task 12980: 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:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3607 kmalloc include/linux/slab.h:516 [inline] kzalloc include/linux/slab.h:705 [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+0x1f/0x96 Freed by task 12970: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3485 [inline] kfree+0xd6/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+0x1f/0x96 The buggy address belongs to the object at ffff8801c06dc140 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff8801c06dc140, ffff8801c06dc940) The buggy address belongs to the page: page:ffffea000701b700 count:1 mapcount:0 mapping:ffff8801c06dc140 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801c06dc140 0000000000000000 0000000100000003 raw: ffffea000704eaa0 ffffea0007014220 ffff8801dac00c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c06dc000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c06dc080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c06dc100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8801c06dc180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c06dc200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================