gfs2: fsid=syz:syz.0: GFS2:adding buf while withdrawn! 0x821 gfs2: fsid=syz:syz.0: GFS2:adding buf while withdrawn! 0x903 ================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x31/0x190 lib/list_debug.c:49 Read of size 8 at addr ffff888011bb4870 by task syz.0.0/5333 CPU: 0 UID: 0 PID: 5333 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 __list_del_entry_valid_or_report+0x31/0x190 lib/list_debug.c:49 __list_del_entry_valid include/linux/list.h:132 [inline] __list_del_entry include/linux/list.h:223 [inline] list_del_init include/linux/list.h:295 [inline] gfs2_remove_from_journal+0x250/0x700 fs/gfs2/meta_io.c:352 gfs2_journal_wipe+0x3b3/0x8b0 fs/gfs2/meta_io.c:461 gfs2_dinode_dealloc+0x312/0x3f0 fs/gfs2/inode.c:509 evict_unlinked_inode fs/gfs2/super.c:1319 [inline] gfs2_evict_inode+0xe64/0x1050 fs/gfs2/super.c:1416 evict+0x61e/0xb10 fs/inode.c:846 __dentry_kill+0x1a2/0x5e0 fs/dcache.c:670 finish_dput+0xc9/0x480 fs/dcache.c:879 __fput+0x691/0xa70 fs/file_table.c:477 task_work_run+0x1d9/0x270 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:67 [inline] exit_to_user_mode_loop+0xed/0x480 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline] do_syscall_64+0x32d/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f351bb9c819 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fffd40c3e98 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f351be17da0 RCX: 00007f351bb9c819 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f351be17da0 R08: 0000000000000006 R09: 0000000000000000 R10: 00007f351be17cb0 R11: 0000000000000246 R12: 00000000000199e6 R13: 00007f351be15fac R14: 000000000001997e R15: 00007fffd40c3fa0 Allocated by task 5334: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4538 [inline] slab_alloc_node mm/slub.c:4866 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4873 gfs2_alloc_bufdata fs/gfs2/trans.c:173 [inline] gfs2_trans_add_meta+0x2ce/0x960 fs/gfs2/trans.c:276 init_dinode+0x92/0xa70 fs/gfs2/inode.c:581 gfs2_create_inode+0x115a/0x1630 fs/gfs2/inode.c:863 gfs2_atomic_open+0x116/0x200 fs/gfs2/inode.c:1402 atomic_open+0x14f/0x370 fs/namei.c:4342 lookup_open fs/namei.c:4455 [inline] open_last_lookups fs/namei.c:4589 [inline] path_openat+0x10e9/0x3860 fs/namei.c:4833 do_file_open+0x23e/0x4a0 fs/namei.c:4865 do_sys_openat2+0x113/0x200 fs/open.c:1366 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1383 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 30: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2685 [inline] slab_free mm/slub.c:6165 [inline] kmem_cache_free+0x187/0x630 mm/slub.c:6295 trans_drain fs/gfs2/log.c:1008 [inline] gfs2_log_flush+0x13cf/0x2510 fs/gfs2/log.c:1154 gfs2_write_inode+0x23f/0x3e0 fs/gfs2/super.c:449 write_inode fs/fs-writeback.c:1582 [inline] __writeback_single_inode+0x75a/0x11a0 fs/fs-writeback.c:1825 writeback_sb_inodes+0x992/0x1a20 fs/fs-writeback.c:2054 __writeback_inodes_wb+0x111/0x240 fs/fs-writeback.c:2130 wb_writeback+0x46a/0xb70 fs/fs-writeback.c:2241 wb_check_start_all fs/fs-writeback.c:2367 [inline] wb_do_writeback fs/fs-writeback.c:2393 [inline] wb_workfn+0x95b/0xf50 fs/fs-writeback.c:2426 process_one_work kernel/workqueue.c:3276 [inline] process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888011bb4850 which belongs to the cache gfs2_bufdata of size 80 The buggy address is located 32 bytes inside of freed 80-byte region [ffff888011bb4850, ffff888011bb48a0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888011bb4a80 pfn:0x11bb4 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff8880313f9780 ffff88801cd22d08 ffff88801cd22d08 raw: ffff888011bb4a80 0000000800240018 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5334, tgid 5333 (syz.0.0), ts 104891010581, free_ts 104165543378 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 alloc_slab_page mm/slub.c:3292 [inline] allocate_slab+0x77/0x660 mm/slub.c:3481 new_slab mm/slub.c:3539 [inline] refill_objects+0x331/0x3c0 mm/slub.c:7175 refill_sheaf mm/slub.c:2812 [inline] alloc_full_sheaf mm/slub.c:2834 [inline] __pcs_replace_empty_main+0x40a/0x730 mm/slub.c:4626 alloc_from_pcs mm/slub.c:4717 [inline] slab_alloc_node mm/slub.c:4851 [inline] kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4873 gfs2_alloc_bufdata fs/gfs2/trans.c:173 [inline] gfs2_trans_add_meta+0x2ce/0x960 fs/gfs2/trans.c:276 gfs2_alloc_extent fs/gfs2/rgrp.c:2237 [inline] gfs2_alloc_blocks+0x7ae/0x2090 fs/gfs2/rgrp.c:2447 alloc_dinode+0x252/0x560 fs/gfs2/inode.c:436 gfs2_create_inode+0xc4a/0x1630 fs/gfs2/inode.c:822 gfs2_atomic_open+0x116/0x200 fs/gfs2/inode.c:1402 atomic_open+0x14f/0x370 fs/namei.c:4342 lookup_open fs/namei.c:4455 [inline] open_last_lookups fs/namei.c:4589 [inline] path_openat+0x10e9/0x3860 fs/namei.c:4833 do_file_open+0x23e/0x4a0 fs/namei.c:4865 do_sys_openat2+0x113/0x200 fs/open.c:1366 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0xc2b/0xdb0 mm/page_alloc.c:2978 __tlb_remove_table_free mm/mmu_gather.c:228 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:291 rcu_do_batch kernel/rcu/tree.c:2617 [inline] rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869 handle_softirqs+0x22a/0x870 kernel/softirq.c:622 run_ksoftirqd+0x36/0x60 kernel/softirq.c:1063 smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888011bb4700: fa fb fb fb fb fb fb fb fb fb fc fc fc fc fa fb ffff888011bb4780: fb fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb >ffff888011bb4800: fb fb fb fb fb fb fc fc fc fc fa fb fb fb fb fb ^ ffff888011bb4880: fb fb fb fb fc fc fc fc fa fb fb fb fb fb fb fb ffff888011bb4900: fb fb fc fc fc fc fa fb fb fb fb fb fb fb fb fb ==================================================================