================================================================== BUG: KASAN: slab-use-after-free in list_empty include/linux/list.h:381 [inline] BUG: KASAN: slab-use-after-free in gfs2_discard fs/gfs2/aops.c:593 [inline] BUG: KASAN: slab-use-after-free in gfs2_invalidate_folio+0x40b/0x750 fs/gfs2/aops.c:631 Read of size 8 at addr ffff8880570b9168 by task syz-executor/23934 CPU: 0 UID: 0 PID: 23934 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 list_empty include/linux/list.h:381 [inline] gfs2_discard fs/gfs2/aops.c:593 [inline] gfs2_invalidate_folio+0x40b/0x750 fs/gfs2/aops.c:631 folio_invalidate mm/truncate.c:140 [inline] truncate_cleanup_folio+0x2d8/0x430 mm/truncate.c:160 truncate_inode_pages_range+0x233/0xda0 mm/truncate.c:381 gfs2_evict_inode+0x87a/0x1000 fs/gfs2/super.c:1442 evict+0x504/0x9c0 fs/inode.c:810 gfs2_evict_inodes fs/gfs2/ops_fstype.c:1761 [inline] gfs2_kill_sb+0x234/0x340 fs/gfs2/ops_fstype.c:1787 deactivate_locked_super+0xbc/0x130 fs/super.c:473 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1327 task_work_run+0x1d4/0x260 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x6b5/0x2300 kernel/exit.c:966 do_group_exit+0x21c/0x2d0 kernel/exit.c:1107 __do_sys_exit_group kernel/exit.c:1118 [inline] __se_sys_exit_group kernel/exit.c:1116 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1116 x64_sys_call+0x21f7/0x2200 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1dda98efc9 Code: Unable to access opcode bytes at 0x7f1dda98ef9f. RSP: 002b:00007ffe2a1d32f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f1ddaa11da2 RCX: 00007f1dda98efc9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000005 R08: 00007ffe2a1d1097 R09: 00007ffe2a1d4550 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe2a1d4550 R13: 00007f1ddaa11d7d R14: 000000000026d25d R15: 00007ffe2a1d4590 Allocated by task 31536: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 unpoison_slab_object mm/kasan/common.c:339 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:365 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4962 [inline] slab_alloc_node mm/slub.c:5272 [inline] kmem_cache_alloc_noprof+0x37d/0x700 mm/slub.c:5279 gfs2_alloc_bufdata fs/gfs2/trans.c:168 [inline] gfs2_trans_add_data+0x200/0x620 fs/gfs2/trans.c:209 gfs2_trans_add_databufs+0x12f/0x1a0 fs/gfs2/trans.c:246 gfs2_iomap_put_folio+0x223/0x480 fs/gfs2/bmap.c:995 iomap_write_iter fs/iomap/buffered-io.c:1020 [inline] iomap_file_buffered_write+0x593/0x9b0 fs/iomap/buffered-io.c:1071 gfs2_file_buffered_write+0x4ed/0x880 fs/gfs2/file.c:1061 gfs2_file_write_iter+0x94e/0x1100 fs/gfs2/file.c:1166 aio_write+0x535/0x7a0 fs/aio.c:1634 __io_submit_one fs/aio.c:-1 [inline] io_submit_one+0x78b/0x1310 fs/aio.c:2053 __do_sys_io_submit fs/aio.c:2112 [inline] __se_sys_io_submit+0x185/0x2f0 fs/aio.c:2082 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 31536: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2530 [inline] slab_free mm/slub.c:6619 [inline] kmem_cache_free+0x19b/0x690 mm/slub.c:6729 trans_drain fs/gfs2/log.c:1015 [inline] gfs2_log_flush+0x17a2/0x24c0 fs/gfs2/log.c:1153 gfs2_jdata_writepages+0xf9/0x150 fs/gfs2/aops.c:374 do_writepages+0x32e/0x550 mm/page-writeback.c:2604 filemap_fdatawrite_wbc mm/filemap.c:389 [inline] __filemap_fdatawrite_range mm/filemap.c:422 [inline] filemap_fdatawrite_range+0x1a5/0x250 mm/filemap.c:440 gfs2_fsync+0xd8/0x370 fs/gfs2/file.c:752 generic_write_sync include/linux/fs.h:3046 [inline] gfs2_file_write_iter+0xeb7/0x1100 fs/gfs2/file.c:1168 aio_write+0x535/0x7a0 fs/aio.c:1634 __io_submit_one fs/aio.c:-1 [inline] io_submit_one+0x78b/0x1310 fs/aio.c:2053 __do_sys_io_submit fs/aio.c:2112 [inline] __se_sys_io_submit+0x185/0x2f0 fs/aio.c:2082 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880570b9150 which belongs to the cache gfs2_bufdata of size 80 The buggy address is located 24 bytes inside of freed 80-byte region [ffff8880570b9150, ffff8880570b91a0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x570b9 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff888142ad9b40 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080240024 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 0x52c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 31536, tgid 31520 (syz.8.7123), ts 2544073469779, free_ts 2544054827555 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3920 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5214 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2418 alloc_slab_page mm/slub.c:3046 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3219 new_slab mm/slub.c:3273 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4643 __slab_alloc+0x65/0x100 mm/slub.c:4762 __slab_alloc_node mm/slub.c:4838 [inline] slab_alloc_node mm/slub.c:5260 [inline] kmem_cache_alloc_noprof+0x40f/0x700 mm/slub.c:5279 gfs2_alloc_bufdata fs/gfs2/trans.c:168 [inline] gfs2_trans_add_meta+0x2cf/0x960 fs/gfs2/trans.c:271 init_dinode+0x92/0xa70 fs/gfs2/inode.c:567 gfs2_create_inode+0x10c5/0x1560 fs/gfs2/inode.c:848 gfs2_atomic_open+0x116/0x200 fs/gfs2/inode.c:1387 atomic_open fs/namei.c:3656 [inline] lookup_open fs/namei.c:3767 [inline] open_last_lookups fs/namei.c:3895 [inline] path_openat+0xf66/0x3830 fs/namei.c:4131 do_filp_open+0x1fa/0x410 fs/namei.c:4161 do_sys_openat2+0x121/0x1c0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1463 page last free pid 22785 tgid 22785 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] free_unref_folios+0xd22/0x1460 mm/page_alloc.c:3005 folios_put_refs+0x584/0x670 mm/swap.c:1002 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x346/0xda0 mm/truncate.c:385 ocfs2_evict_inode+0x1af/0x4100 fs/ocfs2/inode.c:1297 evict+0x504/0x9c0 fs/inode.c:810 ocfs2_dentry_iput+0x247/0x370 fs/ocfs2/dcache.c:407 __dentry_kill+0x209/0x660 fs/dcache.c:669 shrink_kill+0xa9/0x2c0 fs/dcache.c:1114 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1141 shrink_dcache_parent+0xa1/0x2c0 fs/dcache.c:-1 do_one_tree+0x23/0xe0 fs/dcache.c:1604 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1621 generic_shutdown_super+0x67/0x2c0 fs/super.c:620 kill_block_super+0x44/0x90 fs/super.c:1722 deactivate_locked_super+0xbc/0x130 fs/super.c:473 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1327 Memory state around the buggy address: ffff8880570b9000: fa fb fb fb fb fb fb fb fb fb fc fc fc fc fa fb ffff8880570b9080: fb fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb >ffff8880570b9100: fb fb fb fb fb fb fc fc fc fc fa fb fb fb fb fb ^ ffff8880570b9180: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff8880570b9200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================