kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:72 [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 qd_unlock+0x20/0x190 fs/gfs2/quota.c:490 Read of size 8 at addr ffff888075161090 by task gfs2_quotad/5087 CPU: 1 PID: 5087 Comm: gfs2_quotad Not tainted 6.2.0-next-20230306-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:187 instrument_atomic_read include/linux/instrumented.h:72 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] qd_unlock+0x20/0x190 fs/gfs2/quota.c:490 gfs2_quota_sync+0x39d/0x660 fs/gfs2/quota.c:1325 quotad_check_timeo fs/gfs2/quota.c:1508 [inline] quotad_check_timeo fs/gfs2/quota.c:1502 [inline] gfs2_quotad+0x10e/0x580 fs/gfs2/quota.c:1555 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 5082: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:769 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x17c/0x320 mm/slub.c:3476 kmem_cache_zalloc include/linux/slab.h:710 [inline] qd_alloc+0x4e/0x300 fs/gfs2/quota.c:216 gfs2_quota_init+0x7d1/0xf90 fs/gfs2/quota.c:1415 gfs2_make_fs_rw+0x3a0/0x5c0 fs/gfs2/super.c:155 gfs2_fill_super+0x208c/0x2b20 fs/gfs2/ops_fstype.c:1280 get_tree_bdev+0x444/0x760 fs/super.c:1294 gfs2_get_tree+0x4e/0x270 fs/gfs2/ops_fstype.c:1338 vfs_get_tree+0x8d/0x350 fs/super.c:1501 do_new_mount fs/namespace.c:3042 [inline] path_mount+0x1342/0x1e40 fs/namespace.c:3372 do_mount fs/namespace.c:3385 [inline] __do_sys_mount fs/namespace.c:3594 [inline] __se_sys_mount fs/namespace.c:3571 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3571 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5087: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] kmem_cache_free+0xec/0x4e0 mm/slub.c:3809 rcu_do_batch kernel/rcu/tree.c:2112 [inline] rcu_core+0x882/0x19c0 kernel/rcu/tree.c:2372 __do_softirq+0x2e3/0xae3 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7d0 kernel/rcu/tree.c:2622 gfs2_quota_cleanup+0x483/0x860 fs/gfs2/quota.c:1479 gfs2_make_fs_ro+0x249/0x6d0 fs/gfs2/super.c:566 signal_our_withdraw fs/gfs2/util.c:166 [inline] gfs2_withdraw+0xec8/0x1490 fs/gfs2/util.c:351 gfs2_dinode_in fs/gfs2/glops.c:463 [inline] gfs2_inode_refresh+0xcd1/0x1070 fs/gfs2/glops.c:483 inode_go_instantiate+0x4a/0x70 fs/gfs2/glops.c:502 gfs2_instantiate+0x16a/0x250 fs/gfs2/glock.c:454 gfs2_glock_holder_ready fs/gfs2/glock.c:1319 [inline] gfs2_glock_holder_ready fs/gfs2/glock.c:1315 [inline] gfs2_glock_wait+0x197/0x2e0 fs/gfs2/glock.c:1339 gfs2_glock_nq+0xd7a/0x17a0 fs/gfs2/glock.c:1587 gfs2_glock_nq_init fs/gfs2/glock.h:261 [inline] do_sync+0x62f/0xcf0 fs/gfs2/quota.c:916 gfs2_quota_sync+0x2e6/0x660 fs/gfs2/quota.c:1318 quotad_check_timeo fs/gfs2/quota.c:1508 [inline] quotad_check_timeo fs/gfs2/quota.c:1502 [inline] gfs2_quotad+0x10e/0x580 fs/gfs2/quota.c:1555 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff888075161000 which belongs to the cache gfs2_quotad of size 272 The buggy address is located 144 bytes inside of freed 272-byte region [ffff888075161000, ffff888075161110) The buggy address belongs to the physical page: page:ffffea0001d45840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x75161 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff88801c448780 dead000000000122 0000000000000000 raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x12c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_RECLAIMABLE), pid 5082, tgid 5082 (syz-executor427), ts 84135020072, free_ts 27380818557 prep_new_page mm/page_alloc.c:2492 [inline] get_page_from_freelist+0xf75/0x2ad0 mm/page_alloc.c:4236 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5502 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x28e/0x380 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x307/0x320 mm/slub.c:3476 kmem_cache_zalloc include/linux/slab.h:710 [inline] qd_alloc+0x4e/0x300 fs/gfs2/quota.c:216 gfs2_quota_init+0x7d1/0xf90 fs/gfs2/quota.c:1415 gfs2_make_fs_rw+0x3a0/0x5c0 fs/gfs2/super.c:155 gfs2_fill_super+0x208c/0x2b20 fs/gfs2/ops_fstype.c:1280 get_tree_bdev+0x444/0x760 fs/super.c:1294 gfs2_get_tree+0x4e/0x270 fs/gfs2/ops_fstype.c:1338 vfs_get_tree+0x8d/0x350 fs/super.c:1501 do_new_mount fs/namespace.c:3042 [inline] path_mount+0x1342/0x1e40 fs/namespace.c:3372 do_mount fs/namespace.c:3385 [inline] __do_sys_mount fs/namespace.c:3594 [inline] __se_sys_mount fs/namespace.c:3571 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3571 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_unref_page_prepare+0x4d1/0xb60 mm/page_alloc.c:3298 free_unref_page+0x33/0x370 mm/page_alloc.c:3393 free_contig_range+0xb5/0x180 mm/page_alloc.c:9439 destroy_args+0x6c4/0x920 mm/debug_vm_pgtable.c:1023 debug_vm_pgtable+0x242a/0x4640 mm/debug_vm_pgtable.c:1403 do_one_initcall+0x141/0x7d0 init/main.c:1306 do_initcall_level init/main.c:1379 [inline] do_initcalls init/main.c:1395 [inline] do_basic_setup init/main.c:1414 [inline] kernel_init_freeable+0x5ec/0x900 init/main.c:1634 kernel_init+0x1e/0x2c0 init/main.c:1522 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff888075160f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888075161000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888075161080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075161100: fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888075161180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================