RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f22cb1d1307 RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffd175dcff0 RBP: 00007ffd175dcff0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000202 R12: 00007ffd175de050 R13: 0000555555b1b6c0 R14: 0000000000000004 R15: 431bde82d7b634db ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [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:492 Read of size 8 at addr ffff888072be8b10 by task syz-executor291/5012 CPU: 0 PID: 5012 Comm: syz-executor291 Not tainted 6.5.0-rc6-syzkaller-00200-gd4ddefee5160 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0xef/0x190 mm/kasan/generic.c:187 instrument_atomic_read include/linux/instrumented.h:68 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] qd_unlock+0x20/0x190 fs/gfs2/quota.c:492 gfs2_quota_sync+0x2e9/0x5f0 fs/gfs2/quota.c:1327 gfs2_sync_fs+0x44/0xb0 fs/gfs2/super.c:680 sync_filesystem fs/sync.c:56 [inline] sync_filesystem+0x109/0x280 fs/sync.c:30 generic_shutdown_super+0x74/0x480 fs/super.c:472 kill_block_super+0x64/0xb0 fs/super.c:1417 gfs2_kill_sb+0x361/0x410 fs/gfs2/ops_fstype.c:1795 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 ptrace_notify+0x10c/0x130 kernel/signal.c:2376 ptrace_report_syscall include/linux/ptrace.h:411 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline] syscall_exit_work kernel/entry/common.c:252 [inline] syscall_exit_to_user_mode_prepare+0x120/0x220 kernel/entry/common.c:279 __syscall_exit_to_user_mode_work kernel/entry/common.c:284 [inline] syscall_exit_to_user_mode+0xd/0x50 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f22cb1d1307 Code: 08 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffd175dcf38 EFLAGS: 00000202 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f22cb1d1307 RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffd175dcff0 RBP: 00007ffd175dcff0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000202 R12: 00007ffd175de050 R13: 0000555555b1b6c0 R14: 0000000000000004 R15: 431bde82d7b634db Allocated by task 5026: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x15e/0x400 mm/slab.c:3432 kmem_cache_zalloc include/linux/slab.h:693 [inline] qd_alloc+0x4e/0x2e0 fs/gfs2/quota.c:219 gfs2_quota_init+0x63d/0xff0 fs/gfs2/quota.c:1417 gfs2_make_fs_rw+0x3e6/0x5c0 fs/gfs2/super.c:155 gfs2_fill_super+0x263b/0x2b10 fs/gfs2/ops_fstype.c:1275 get_tree_bdev+0x43e/0x7d0 fs/super.c:1318 gfs2_get_tree+0x4e/0x280 fs/gfs2/ops_fstype.c:1333 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 0: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13f/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] __cache_free mm/slab.c:3370 [inline] __do_kmem_cache_free mm/slab.c:3557 [inline] kmem_cache_free+0x104/0x380 mm/slab.c:3582 rcu_do_batch kernel/rcu/tree.c:2135 [inline] rcu_core+0x7fb/0x1bb0 kernel/rcu/tree.c:2399 __do_softirq+0x218/0x965 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 gfs2_quota_cleanup+0x46c/0x860 fs/gfs2/quota.c:1481 gfs2_make_fs_ro+0x24b/0x740 fs/gfs2/super.c:588 signal_our_withdraw fs/gfs2/util.c:153 [inline] gfs2_withdraw+0xc2e/0x10c0 fs/gfs2/util.c:334 gfs2_dinode_in fs/gfs2/glops.c:469 [inline] gfs2_inode_refresh+0xcf6/0x1120 fs/gfs2/glops.c:489 inode_go_instantiate+0x47/0x60 fs/gfs2/glops.c:508 gfs2_instantiate+0x167/0x240 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+0x210/0x330 fs/gfs2/glock.c:1339 gfs2_glock_nq+0xd9f/0x17b0 fs/gfs2/glock.c:1587 gfs2_glock_nq_init fs/gfs2/glock.h:261 [inline] do_sync+0x66e/0xc90 fs/gfs2/quota.c:918 gfs2_quota_sync+0x2a0/0x5f0 fs/gfs2/quota.c:1320 gfs2_sync_fs+0x44/0xb0 fs/gfs2/super.c:680 sync_filesystem fs/sync.c:56 [inline] sync_filesystem+0x109/0x280 fs/sync.c:30 generic_shutdown_super+0x74/0x480 fs/super.c:472 kill_block_super+0x64/0xb0 fs/super.c:1417 gfs2_kill_sb+0x361/0x410 fs/gfs2/ops_fstype.c:1795 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 ptrace_notify+0x10c/0x130 kernel/signal.c:2376 ptrace_report_syscall include/linux/ptrace.h:411 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline] syscall_exit_work kernel/entry/common.c:252 [inline] syscall_exit_to_user_mode_prepare+0x120/0x220 kernel/entry/common.c:279 __syscall_exit_to_user_mode_work kernel/entry/common.c:284 [inline] syscall_exit_to_user_mode+0xd/0x50 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888072be8a80 which belongs to the cache gfs2_quotad of size 272 The buggy address is located 144 bytes inside of freed 272-byte region [ffff888072be8a80, ffff888072be8b90) The buggy address belongs to the physical page: page:ffffea0001cafa00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x72be8 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xc() raw: 00fff00000000200 ffff888015f8f600 ffff888016319e50 ffff888016319e50 raw: 0000000000000000 ffff888072be8000 000000010000000c 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 0x242050(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE|__GFP_RECLAIMABLE), pid 5013, tgid 5013 (syz-executor291), ts 61141342081, free_ts 16648173226 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x3a6/0x400 mm/slab.c:3432 kmem_cache_zalloc include/linux/slab.h:693 [inline] qd_alloc+0x4e/0x2e0 fs/gfs2/quota.c:219 gfs2_quota_init+0x63d/0xff0 fs/gfs2/quota.c:1417 gfs2_make_fs_rw+0x3e6/0x5c0 fs/gfs2/super.c:155 gfs2_fill_super+0x263b/0x2b10 fs/gfs2/ops_fstype.c:1275 get_tree_bdev+0x43e/0x7d0 fs/super.c:1318 gfs2_get_tree+0x4e/0x280 fs/gfs2/ops_fstype.c:1333 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 free_contig_range+0xb6/0x190 mm/page_alloc.c:6395 destroy_args+0x686/0x940 mm/debug_vm_pgtable.c:1029 debug_vm_pgtable+0x2339/0x3ff0 mm/debug_vm_pgtable.c:1410 do_one_initcall+0x117/0x630 init/main.c:1232 do_initcall_level init/main.c:1294 [inline] do_initcalls init/main.c:1310 [inline] do_basic_setup init/main.c:1329 [inline] kernel_init_freeable+0x5bd/0x8f0 init/main.c:1546 kernel_init+0x1c/0x2a0 init/main.c:1437 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888072be8a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888072be8a80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888072be8b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888072be8b80: fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb ffff888072be8c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================