gfs2: can't alloc struct gfs2_sbd ================================================================== BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] BUG: KASAN: use-after-free in gfs2_log_flush+0x1ec/0x29b0 fs/gfs2/log.c:779 Read of size 4 at addr ffff88017f48e360 by task syz-executor5/26641 CPU: 1 PID: 26641 Comm: syz-executor5 Not tainted 4.19.0-rc6-next-20181005+ #88 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d3/0x2c4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272 atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] gfs2_log_flush+0x1ec/0x29b0 fs/gfs2/log.c:779 gfs2_kill_sb+0x5b/0x1a0 fs/gfs2/ops_fstype.c:1368 deactivate_locked_super+0x97/0x100 fs/super.c:328 gfs2_mount+0x568/0x712 fs/gfs2/ops_fstype.c:1317 legacy_get_tree+0x131/0x460 fs/fs_context.c:718 vfs_get_tree+0x1cb/0x5c0 fs/super.c:1795 do_new_mount fs/namespace.c:2648 [inline] do_mount+0x70c/0x1d90 fs/namespace.c:2974 ksys_mount+0x12d/0x140 fs/namespace.c:3190 __do_sys_mount fs/namespace.c:3204 [inline] __se_sys_mount fs/namespace.c:3201 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3201 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459fea Code: b8 a6 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 9d 89 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 7a 89 fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007f47705dfa88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f47705dfb30 RCX: 0000000000459fea RDX: 00007f47705dfad0 RSI: 0000000020000380 RDI: 00007f47705dfaf0 RBP: 0000000020000380 R08: 00007f47705dfb30 R09: 00007f47705dfad0 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000008 R13: 0000000000000000 R14: 00000000004d7db8 R15: 00000000ffffffff Allocated by task 26641: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620 kmalloc include/linux/slab.h:546 [inline] kzalloc include/linux/slab.h:741 [inline] init_sbd+0x13f/0xfa0 fs/gfs2/ops_fstype.c:71 fill_super+0xab/0x1a10 fs/gfs2/ops_fstype.c:1041 gfs2_mount+0x5e6/0x712 fs/gfs2/ops_fstype.c:1303 legacy_get_tree+0x131/0x460 fs/fs_context.c:718 vfs_get_tree+0x1cb/0x5c0 fs/super.c:1795 do_new_mount fs/namespace.c:2648 [inline] do_mount+0x70c/0x1d90 fs/namespace.c:2974 ksys_mount+0x12d/0x140 fs/namespace.c:3190 __do_sys_mount fs/namespace.c:3204 [inline] __se_sys_mount fs/namespace.c:3201 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3201 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 26641: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 init_sbd+0xe39/0xfa0 fs/gfs2/ops_fstype.c:79 fill_super+0xab/0x1a10 fs/gfs2/ops_fstype.c:1041 gfs2_mount+0x5e6/0x712 fs/gfs2/ops_fstype.c:1303 legacy_get_tree+0x131/0x460 fs/fs_context.c:718 vfs_get_tree+0x1cb/0x5c0 fs/super.c:1795 do_new_mount fs/namespace.c:2648 [inline] do_mount+0x70c/0x1d90 fs/namespace.c:2974 ksys_mount+0x12d/0x140 fs/namespace.c:3190 __do_sys_mount fs/namespace.c:3204 [inline] __se_sys_mount fs/namespace.c:3201 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3201 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88017f48d3c0 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4000 bytes inside of 8192-byte region [ffff88017f48d3c0, ffff88017f48f3c0) The buggy address belongs to the page: page:ffffea0005fd2300 count:1 mapcount:0 mapping:ffff8801da802080 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0005fde508 ffffea0005fa9208 ffff8801da802080 raw: 0000000000000000 ffff88017f48d3c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88017f48e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88017f48e280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88017f48e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88017f48e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88017f48e400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================