IPVS: Creating netns size=2536 id=4 IPVS: Creating netns size=2536 id=5 IPVS: Creating netns size=2536 id=6 ================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x51/0x60 block/genhd.c:1550 Read of size 8 at addr ffff8801d97d0560 by task blkid/3837 CPU: 0 PID: 3837 Comm: blkid Not tainted 4.9.86-gd3a2afb #51 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801d79576f0 ffffffff81d956f9 ffffea000765f400 ffff8801d97d0560 0000000000000000 ffff8801d97d0560 0000000000000000 ffff8801d7957728 ffffffff8153e083 ffff8801d97d0560 0000000000000008 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x73/0x280 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report+0x275/0x360 mm/kasan/report.c:408 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] disk_unblock_events+0x51/0x60 block/genhd.c:1550 [] __blkdev_get+0x4b5/0xd50 fs/block_dev.c:1360 [] blkdev_get+0x33b/0x960 fs/block_dev.c:1416 [] blkdev_open+0x1a5/0x250 fs/block_dev.c:1571 [] do_dentry_open+0x607/0xc60 fs/open.c:766 [] vfs_open+0x105/0x220 fs/open.c:879 [] do_last fs/namei.c:3411 [inline] [] path_openat+0x5ac/0x2910 fs/namei.c:3534 [] do_filp_open+0x197/0x290 fs/namei.c:3569 [] do_sys_open+0x366/0x620 fs/open.c:1072 [] SYSC_open fs/open.c:1090 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1085 [] do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 3825: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:609 kmem_cache_alloc_trace+0xfb/0x2a0 mm/slub.c:2742 kmem_cache_alloc_node_trace include/linux/slab.h:381 [inline] kmalloc_node include/linux/slab.h:528 [inline] kzalloc_node include/linux/slab.h:647 [inline] alloc_disk_node+0x54/0x3b0 block/genhd.c:1294 alloc_disk+0x18/0x20 block/genhd.c:1286 loop_add+0x324/0x770 drivers/block/loop.c:1775 loop_control_ioctl+0x119/0x300 drivers/block/loop.c:1907 vfs_ioctl fs/ioctl.c:43 [inline] do_vfs_ioctl+0x1aa/0x1140 fs/ioctl.c:679 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 3837: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0x103/0x300 mm/slub.c:3878 disk_release+0x259/0x330 block/genhd.c:1147 device_release+0x7c/0x210 drivers/base/core.c:247 kobject_cleanup lib/kobject.c:645 [inline] kobject_release+0xed/0x1a0 lib/kobject.c:674 kref_sub include/linux/kref.h:73 [inline] kref_put include/linux/kref.h:98 [inline] kobject_put+0x63/0xc0 lib/kobject.c:691 put_disk+0x23/0x30 block/genhd.c:1358 __blkdev_get+0x415/0xd50 fs/block_dev.c:1353 blkdev_get+0x33b/0x960 fs/block_dev.c:1416 blkdev_open+0x1a5/0x250 fs/block_dev.c:1571 do_dentry_open+0x607/0xc60 fs/open.c:766 vfs_open+0x105/0x220 fs/open.c:879 do_last fs/namei.c:3411 [inline] path_openat+0x5ac/0x2910 fs/namei.c:3534 do_filp_open+0x197/0x290 fs/namei.c:3569 do_sys_open+0x366/0x620 fs/open.c:1072 SYSC_open fs/open.c:1090 [inline] SyS_open+0x2d/0x40 fs/open.c:1085 do_syscall_64+0x1a4/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb The buggy address belongs to the object at ffff8801d97d0000 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1376 bytes inside of 2048-byte region [ffff8801d97d0000, ffff8801d97d0800) The buggy address belongs to the page: page:ffffea000765f400 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x8000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d97d0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d97d0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d97d0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d97d0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d97d0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== IPVS: Creating netns size=2536 id=7