audit: type=1400 audit(1555885626.121:36): avc: denied { map } for pid=7037 comm="syz-executor688" path="/root/syz-executor688670550" dev="sda1" ino=1426 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 ================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1644 Read of size 8 at addr ffff8880a48d2648 by task syz-executor688/7067 CPU: 1 PID: 7067 Comm: syz-executor688 Not tainted 4.14.113 #3 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+0x138/0x19c lib/dump_stack.c:53 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xaf/0x2b5 mm/kasan/report.c:393 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 disk_unblock_events+0x55/0x60 block/genhd.c:1644 __blkdev_get+0x7d8/0x1120 fs/block_dev.c:1556 blkdev_get+0xa8/0x8e0 fs/block_dev.c:1612 blkdev_open+0x1d1/0x260 fs/block_dev.c:1770 do_dentry_open+0x73e/0xeb0 fs/open.c:758 vfs_open+0x105/0x230 fs/open.c:872 do_last fs/namei.c:3425 [inline] path_openat+0x8bd/0x3f70 fs/namei.c:3566 do_filp_open+0x18e/0x250 fs/namei.c:3600 do_sys_open+0x2c5/0x430 fs/open.c:1065 SYSC_open fs/open.c:1083 [inline] SyS_open+0x2d/0x40 fs/open.c:1078 do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x405771 RSP: 002b:00007ff570326980 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000405771 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ff570326990 RBP: 6666666666666667 R08: 000000000000000f R09: 00007ff570327700 R10: 00007ff5703279d0 R11: 0000000000000293 R12: 00000000006dbc4c R13: 00007ffc187ec75f R14: 00007ff5703279c0 R15: 000000000000002d Allocated by task 1: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529 kmem_cache_alloc_node_trace+0x153/0x770 mm/slab.c:3661 kmalloc_node include/linux/slab.h:526 [inline] kzalloc_node include/linux/slab.h:672 [inline] alloc_disk_node+0x64/0x3e0 block/genhd.c:1387 alloc_disk+0x1b/0x20 block/genhd.c:1371 loop_add+0x3f4/0x8d0 drivers/block/loop.c:1859 loop_init+0x19d/0x1e5 drivers/block/loop.c:2104 do_one_initcall+0xa0/0x220 init/main.c:825 do_initcall_level init/main.c:891 [inline] do_initcalls init/main.c:899 [inline] do_basic_setup init/main.c:917 [inline] kernel_init_freeable+0x474/0x538 init/main.c:1074 kernel_init+0x12/0x162 init/main.c:999 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:402 Freed by task 7067: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 disk_release+0x24b/0x2d0 block/genhd.c:1230 device_release+0xfa/0x1b0 drivers/base/core.c:822 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put.cold+0x26f/0x2ff lib/kobject.c:692 put_disk+0x23/0x30 block/genhd.c:1452 __blkdev_get+0x73e/0x1120 fs/block_dev.c:1549 blkdev_get+0xa8/0x8e0 fs/block_dev.c:1612 blkdev_open+0x1d1/0x260 fs/block_dev.c:1770 do_dentry_open+0x73e/0xeb0 fs/open.c:758 vfs_open+0x105/0x230 fs/open.c:872 do_last fs/namei.c:3425 [inline] path_openat+0x8bd/0x3f70 fs/namei.c:3566 do_filp_open+0x18e/0x250 fs/namei.c:3600 do_sys_open+0x2c5/0x430 fs/open.c:1065 SYSC_open fs/open.c:1083 [inline] SyS_open+0x2d/0x40 fs/open.c:1078 do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880a48d20c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1416 bytes inside of 2048-byte region [ffff8880a48d20c0, ffff8880a48d28c0) The buggy address belongs to the page: page:ffffea0002923480 count:1 mapcount:0 mapping:ffff8880a48d20c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff8880a48d20c0 0000000000000000 0000000100000003 raw: ffffea0002921da0 ffffea00029244a0 ffff8880aa800c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a48d2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a48d2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a48d2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a48d2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a48d2700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================