================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:82 [inline] BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] BUG: KASAN: slab-use-after-free in mapping_inaccessible include/linux/pagemap.h:335 [inline] BUG: KASAN: slab-use-after-free in move_to_new_folio+0x13e/0x460 mm/migrate.c:1103 Read of size 8 at addr ffff8880529bec78 by task kcompactd0/28 CPU: 0 UID: 0 PID: 28 Comm: kcompactd0 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+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x264/0x2c0 mm/kasan/generic.c:200 instrument_atomic_read include/linux/instrumented.h:82 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] mapping_inaccessible include/linux/pagemap.h:335 [inline] move_to_new_folio+0x13e/0x460 mm/migrate.c:1103 migrate_folio_move mm/migrate.c:1382 [inline] migrate_folios_move mm/migrate.c:1738 [inline] migrate_pages_batch+0x3061/0x4e50 mm/migrate.c:1994 migrate_pages_sync mm/migrate.c:2024 [inline] migrate_pages+0x1b9f/0x2920 mm/migrate.c:2133 compact_zone+0x310e/0x4a30 mm/compaction.c:2668 compact_node+0x210/0x310 mm/compaction.c:2937 kcompactd+0xc0b/0x12c0 mm/compaction.c:3235 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5323: 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:4612 [inline] slab_alloc_node mm/slub.c:4945 [inline] kmem_cache_alloc_noprof+0x2a0/0x5f0 mm/slub.c:4959 gfs2_glock_get+0x276/0xf20 fs/gfs2/glock.c:1098 gfs2_inode_lookup+0x2a3/0xc30 fs/gfs2/inode.c:149 gfs2_dir_search+0x168/0x220 fs/gfs2/dir.c:1663 gfs2_lookupi+0x45b/0x640 fs/gfs2/inode.c:354 gfs2_jindex_hold fs/gfs2/ops_fstype.c:573 [inline] init_journal+0x5ac/0x2330 fs/gfs2/ops_fstype.c:713 init_inodes+0xdb/0x320 fs/gfs2/ops_fstype.c:844 gfs2_fill_super+0x1942/0x20b0 fs/gfs2/ops_fstype.c:1250 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1634 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1332 vfs_get_tree+0x92/0x2a0 fs/super.c:1694 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3841 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5323: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x40/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:2705 [inline] slab_free mm/slub.c:6405 [inline] kmem_cache_free+0x182/0x650 mm/slub.c:6532 rcu_do_batch kernel/rcu/tree.c:2645 [inline] rcu_core+0x78b/0x10a0 kernel/rcu/tree.c:2897 handle_softirqs+0x225/0x840 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x220 kernel/softirq.c:735 irq_exit_rcu+0x9/0x30 kernel/softirq.c:752 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556 __call_rcu_common kernel/rcu/tree.c:3159 [inline] call_rcu+0xee/0x8b0 kernel/rcu/tree.c:3279 gfs2_glock_free+0x3c/0xa0 fs/gfs2/glock.c:152 gfs2_glock_put_eventually fs/gfs2/super.c:1174 [inline] gfs2_evict_inode+0xd60/0x1400 fs/gfs2/super.c:1511 evict+0x624/0xb50 fs/inode.c:825 gfs2_jindex_free+0x398/0x450 fs/gfs2/super.c:79 init_journal+0x8d9/0x2330 fs/gfs2/ops_fstype.c:826 init_inodes+0xdb/0x320 fs/gfs2/ops_fstype.c:844 gfs2_fill_super+0x1942/0x20b0 fs/gfs2/ops_fstype.c:1250 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1634 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1332 vfs_get_tree+0x92/0x2a0 fs/super.c:1694 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3841 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Second to last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556 insert_work+0x3d/0x330 kernel/workqueue.c:2226 __queue_work+0xcd8/0x10a0 kernel/workqueue.c:2401 queue_delayed_work_on+0x11a/0x1e0 kernel/workqueue.c:2620 queue_delayed_work include/linux/workqueue.h:714 [inline] gfs2_glock_queue_work fs/gfs2/glock.c:224 [inline] do_xmote+0x539/0x770 fs/gfs2/glock.c:745 glock_work_func+0x2ef/0x600 fs/gfs2/glock.c:1011 process_one_work kernel/workqueue.c:3322 [inline] process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 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 ffff8880529be8c0 which belongs to the cache gfs2_glock(aspace) of size 1176 The buggy address is located 952 bytes inside of freed 1176-byte region [ffff8880529be8c0, ffff8880529bed58) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x529bc head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff888032317a00 dead000000000122 0000000000000000 raw: 0000000000000000 00000008000c000c 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff888032317a00 dead000000000122 0000000000000000 head: 0000000000000000 00000008000c000c 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5323, tgid 5322 (syz.0.0), ts 83912776052, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3294 [inline] allocate_slab+0x79/0x5e0 mm/slub.c:3408 new_slab mm/slub.c:3454 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7338 refill_sheaf mm/slub.c:2832 [inline] __pcs_replace_empty_main+0x2bf/0x6b0 mm/slub.c:4703 alloc_from_pcs mm/slub.c:4801 [inline] slab_alloc_node mm/slub.c:4933 [inline] kmem_cache_alloc_noprof+0x382/0x5f0 mm/slub.c:4959 gfs2_glock_get+0x276/0xf20 fs/gfs2/glock.c:1098 gfs2_inode_lookup+0x2a3/0xc30 fs/gfs2/inode.c:149 gfs2_lookup_root fs/gfs2/ops_fstype.c:426 [inline] init_sb+0xa55/0x1300 fs/gfs2/ops_fstype.c:495 gfs2_fill_super+0x1615/0x20b0 fs/gfs2/ops_fstype.c:1217 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1634 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1332 vfs_get_tree+0x92/0x2a0 fs/super.c:1694 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3841 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4367 page_owner free stack trace missing Memory state around the buggy address: ffff8880529beb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880529beb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880529bec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880529bec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880529bed00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ==================================================================