================================================================== 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_unevictable include/linux/pagemap.h:269 [inline] BUG: KASAN: slab-use-after-free in folio_evictable+0xe4/0x250 mm/internal.h:575 Read of size 8 at addr ffff888012ba2c78 by task kswapd0/75 CPU: 0 UID: 0 PID: 75 Comm: kswapd0 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_unevictable include/linux/pagemap.h:269 [inline] folio_evictable+0xe4/0x250 mm/internal.h:575 sort_folio mm/vmscan.c:4589 [inline] scan_folios mm/vmscan.c:4692 [inline] isolate_folios mm/vmscan.c:4780 [inline] evict_folios+0x1a9d/0x49e0 mm/vmscan.c:4822 try_to_shrink_lruvec+0xb4f/0xed0 mm/vmscan.c:4983 shrink_one+0x233/0x730 mm/vmscan.c:5024 shrink_many mm/vmscan.c:5087 [inline] lru_gen_shrink_node mm/vmscan.c:5165 [inline] shrink_node+0x3303/0x3b60 mm/vmscan.c:6154 kswapd_shrink_node mm/vmscan.c:7008 [inline] balance_pgdat mm/vmscan.c:7186 [inline] kswapd+0x17b6/0x31c0 mm/vmscan.c:7462 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 5311: 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:4584 [inline] slab_alloc_node mm/slub.c:4917 [inline] kmem_cache_alloc_noprof+0x2a0/0x5f0 mm/slub.c:4931 gfs2_glock_get+0x276/0xf20 fs/gfs2/glock.c:1074 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:575 [inline] init_journal+0x5ac/0x2330 fs/gfs2/ops_fstype.c:715 init_inodes+0xdb/0x320 fs/gfs2/ops_fstype.c:846 gfs2_fill_super+0x1959/0x20d0 fs/gfs2/ops_fstype.c:1252 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1887 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1333 vfs_get_tree+0x92/0x2a0 fs/super.c:1947 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3772 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3848 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4374 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 15: 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:2677 [inline] slab_free mm/slub.c:6377 [inline] kmem_cache_free+0x182/0x650 mm/slub.c:6504 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 run_ksoftirqd+0x36/0x60 kernel/softirq.c:1076 smpboot_thread_fn+0x57c/0xa80 kernel/smpboot.c:160 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 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:150 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:822 gfs2_jindex_free+0x398/0x450 fs/gfs2/super.c:79 init_journal+0x8d9/0x2330 fs/gfs2/ops_fstype.c:828 init_inodes+0xdb/0x320 fs/gfs2/ops_fstype.c:846 gfs2_fill_super+0x1959/0x20d0 fs/gfs2/ops_fstype.c:1252 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1887 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1333 vfs_get_tree+0x92/0x2a0 fs/super.c:1947 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3772 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3848 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4374 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:198 [inline] do_xmote+0x539/0x770 fs/gfs2/glock.c:718 glock_work_func+0x30d/0x610 fs/gfs2/glock.c:987 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 ffff888012ba28c0 which belongs to the cache gfs2_glock(aspace) of size 1176 The buggy address is located 952 bytes inside of freed 1176-byte region [ffff888012ba28c0, ffff888012ba2d58) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12ba0 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff888032445a00 dead000000000122 0000000000000000 raw: 0000000000000000 00000008000c000c 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff888032445a00 dead000000000122 0000000000000000 head: 0000000000000000 00000008000c000c 00000000f5000000 0000000000000000 head: 00fff00000000002 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 5311, tgid 5310 (syz.0.0), ts 97839236090, free_ts 97831467166 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:3266 [inline] allocate_slab+0x79/0x5e0 mm/slub.c:3380 new_slab mm/slub.c:3426 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x2bf/0x6b0 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] kmem_cache_alloc_noprof+0x382/0x5f0 mm/slub.c:4931 gfs2_glock_get+0x276/0xf20 fs/gfs2/glock.c:1074 gfs2_inode_lookup+0x2a3/0xc30 fs/gfs2/inode.c:149 gfs2_lookup_root fs/gfs2/ops_fstype.c:428 [inline] init_sb+0xa55/0x1300 fs/gfs2/ops_fstype.c:497 gfs2_fill_super+0x1634/0x20d0 fs/gfs2/ops_fstype.c:1219 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1887 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1333 vfs_get_tree+0x92/0x2a0 fs/super.c:1947 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3772 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3848 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4374 page last free pid 5311 tgid 5310 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0xc1e/0xd10 mm/page_alloc.c:2950 stack_depot_save_flags+0x407/0x800 lib/stackdepot.c:735 kasan_save_stack mm/kasan/common.c:58 [inline] kasan_save_track+0x4f/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:4584 [inline] slab_alloc_node mm/slub.c:4917 [inline] kmem_cache_alloc_noprof+0x2a0/0x5f0 mm/slub.c:4931 gfs2_glock_get+0x212/0xf20 fs/gfs2/glock.c:1079 gfs2_glock_nq_num+0x53/0x1a0 fs/gfs2/glock.c:1655 init_locking+0xb8/0x210 fs/gfs2/ops_fstype.c:373 gfs2_fill_super+0x1608/0x20d0 fs/gfs2/ops_fstype.c:1215 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1887 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1333 vfs_get_tree+0x92/0x2a0 fs/super.c:1947 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3772 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3848 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4374 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 Memory state around the buggy address: ffff888012ba2b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888012ba2b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888012ba2c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888012ba2c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888012ba2d00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ==================================================================