================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x4b/0x50 block/genhd.c:1644 Read of size 8 at addr ffff8880a47ffa88 by task systemd-udevd/3637 CPU: 0 PID: 3637 Comm: systemd-udevd Not tainted 4.14.184-syzkaller #0 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+0x1b2/0x283 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1dc mm/kasan/report.c:252 ip6_tables: ip6tables: counters copy to user failed while replacing table kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2b9 mm/kasan/report.c:393 disk_unblock_events+0x4b/0x50 block/genhd.c:1644 __blkdev_get+0x79c/0x10c0 fs/block_dev.c:1556 blkdev_get+0x84/0x8a0 fs/block_dev.c:1612 blkdev_open+0x1cc/0x250 fs/block_dev.c:1770 do_dentry_open+0x44b/0xec0 fs/open.c:777 vfs_open+0x105/0x220 fs/open.c:888 do_last fs/namei.c:3428 [inline] path_openat+0xb68/0x2aa0 fs/namei.c:3569 do_filp_open+0x18e/0x250 fs/namei.c:3603 do_sys_open+0x292/0x3e0 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f62a14c4840 RSP: 002b:00007fffe7f26af8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007fffe7f26bb0 RCX: 00007f62a14c4840 RDX: 0000563411e1ffe3 RSI: 00000000000a0800 RDI: 00005634121b9c50 RBP: 00007fffe7f27000 R08: 0000563411e1f670 R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fffe7f26ca0 R13: 00005634120fba60 R14: 00005634121b83e0 R15: 00007fffe7f26b70 Allocated by task 1: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551 kmem_cache_alloc_node_trace+0x153/0x400 mm/slab.c:3661 kmalloc_node include/linux/slab.h:526 [inline] kzalloc_node include/linux/slab.h:672 [inline] alloc_disk_node+0x5d/0x3d0 block/genhd.c:1387 loop_add+0x3cb/0x830 drivers/block/loop.c:1869 loop_init+0x19a/0x1e0 drivers/block/loop.c:2115 do_one_initcall+0x88/0x202 init/main.c:826 do_initcall_level init/main.c:892 [inline] do_initcalls init/main.c:900 [inline] do_basic_setup init/main.c:918 [inline] kernel_init_freeable+0x554/0x615 init/main.c:1075 kernel_init+0xd/0x15b init/main.c:1000 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Freed by task 3637: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xaf/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcb/0x260 mm/slab.c:3815 device_release+0xf0/0x1a0 drivers/base/core.c:831 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x13e/0x1f0 lib/kobject.c:692 put_disk+0x1f/0x30 block/genhd.c:1452 __blkdev_get+0x707/0x10c0 fs/block_dev.c:1549 blkdev_get+0x84/0x8a0 fs/block_dev.c:1612 blkdev_open+0x1cc/0x250 fs/block_dev.c:1770 do_dentry_open+0x44b/0xec0 fs/open.c:777 vfs_open+0x105/0x220 fs/open.c:888 do_last fs/namei.c:3428 [inline] path_openat+0xb68/0x2aa0 fs/namei.c:3569 do_filp_open+0x18e/0x250 fs/namei.c:3603 do_sys_open+0x292/0x3e0 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880a47ff500 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1416 bytes inside of 2048-byte region [ffff8880a47ff500, ffff8880a47ffd00) The buggy address belongs to the page: page:ffffea000291ff80 count:1 mapcount:0 mapping:ffff8880a47fe400 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880a47fe400 0000000000000000 0000000100000003 raw: ffffea0002900ba0 ffffea00029006a0 ffff8880aa800c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a47ff980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a47ffa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a47ffa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a47ffb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a47ffb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================