R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f85c9f08080 R15: 00007ffcf7689fa8 ================================================================== BUG: KASAN: use-after-free in bh_put fs/gfs2/quota.c:414 [inline] BUG: KASAN: use-after-free in qdsb_put fs/gfs2/quota.c:533 [inline] BUG: KASAN: use-after-free in gfs2_quota_unhold+0x17a/0x5d0 fs/gfs2/quota.c:652 Read of size 8 at addr ffff888074ee80c8 by task syz.0.1/4286 CPU: 1 PID: 4286 Comm: syz.0.1 Not tainted 5.15.175-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 bh_put fs/gfs2/quota.c:414 [inline] qdsb_put fs/gfs2/quota.c:533 [inline] gfs2_quota_unhold+0x17a/0x5d0 fs/gfs2/quota.c:652 gfs2_quota_lock+0x3ea/0x450 fs/gfs2/quota.c:1095 gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline] alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402 gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720 gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295 atomic_open fs/namei.c:3325 [inline] lookup_open fs/namei.c:3433 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0xf75/0x2f20 fs/namei.c:3739 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f85c9d17d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f85c7b67038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f85c9f08080 RCX: 00007f85c9d17d29 RDX: 000000000000275a RSI: 0000000020000000 RDI: ffffffffffffff9c RBP: 00007f85c9d93aa8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f85c9f08080 R15: 00007ffcf7689fa8 Allocated by task 4286: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] qd_alloc+0x51/0x250 fs/gfs2/quota.c:216 qd_get+0x23f/0x5c0 fs/gfs2/quota.c:275 qdsb_get+0x2a/0x3b0 fs/gfs2/quota.c:510 gfs2_quota_hold+0x19d/0x5c0 fs/gfs2/quota.c:604 gfs2_quota_lock+0x9f/0x450 fs/gfs2/quota.c:1076 gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline] alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402 gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720 gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295 atomic_open fs/namei.c:3325 [inline] lookup_open fs/namei.c:3433 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0xf75/0x2f20 fs/namei.c:3739 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 14: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x91/0x1f0 mm/slub.c:3515 rcu_do_batch kernel/rcu/tree.c:2523 [inline] rcu_core+0xa15/0x1650 kernel/rcu/tree.c:2763 handle_softirqs+0x3a7/0x930 kernel/softirq.c:558 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:925 smpboot_thread_fn+0x51b/0x9d0 kernel/smpboot.c:164 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3087 gfs2_quota_cleanup+0x43e/0x6a0 fs/gfs2/quota.c:1490 gfs2_make_fs_ro+0x4ad/0x5f0 fs/gfs2/super.c:557 signal_our_withdraw fs/gfs2/util.c:166 [inline] gfs2_withdraw+0x5fb/0x14e0 fs/gfs2/util.c:343 gfs2_meta_check_ii+0x6e/0x80 fs/gfs2/util.c:498 gfs2_metatype_check_i fs/gfs2/util.h:126 [inline] gfs2_meta_buffer+0x324/0x410 fs/gfs2/meta_io.c:493 gfs2_meta_inode_buffer fs/gfs2/meta_io.h:70 [inline] gfs2_inode_refresh+0xdd/0x1070 fs/gfs2/glops.c:481 inode_go_lock+0x12c/0x470 fs/gfs2/glops.c:510 do_promote+0x74b/0xb10 fs/gfs2/glock.c:507 finish_xmote+0x50d/0xb60 fs/gfs2/glock.c:678 do_xmote+0x775/0x10b0 fs/gfs2/glock.c:824 gfs2_glock_nq+0xc32/0x15e0 fs/gfs2/glock.c:1534 gfs2_glock_nq_init fs/gfs2/glock.h:246 [inline] do_glock+0x392/0x730 fs/gfs2/quota.c:1043 gfs2_quota_lock+0x1fc/0x450 fs/gfs2/quota.c:1085 gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline] alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402 gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720 gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295 atomic_open fs/namei.c:3325 [inline] lookup_open fs/namei.c:3433 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0xf75/0x2f20 fs/namei.c:3739 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888074ee8000 which belongs to the cache gfs2_quotad of size 272 The buggy address is located 200 bytes inside of 272-byte region [ffff888074ee8000, ffff888074ee8110) The buggy address belongs to the page: page:ffffea0001d3ba00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x74ee8 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff88801e6d9000 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 0x112c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4286, ts 70004603112, free_ts 18240609174 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5465 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] qd_alloc+0x51/0x250 fs/gfs2/quota.c:216 qd_get+0x23f/0x5c0 fs/gfs2/quota.c:275 qdsb_get+0x2a/0x3b0 fs/gfs2/quota.c:510 gfs2_quota_hold+0x19d/0x5c0 fs/gfs2/quota.c:604 gfs2_quota_lock+0x9f/0x450 fs/gfs2/quota.c:1076 gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline] alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402 gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720 gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295 atomic_open fs/namei.c:3325 [inline] lookup_open fs/namei.c:3433 [inline] open_last_lookups fs/namei.c:3532 [inline] path_openat+0xf75/0x2f20 fs/namei.c:3739 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_contig_range+0x95/0xf0 mm/page_alloc.c:9384 destroy_args+0xfe/0x980 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x40d/0x470 mm/debug_vm_pgtable.c:1331 do_one_initcall+0x22b/0x7a0 init/main.c:1302 do_initcall_level+0x157/0x210 init/main.c:1375 do_initcalls+0x49/0x90 init/main.c:1391 kernel_init_freeable+0x425/0x5c0 init/main.c:1615 kernel_init+0x19/0x290 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff888074ee7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888074ee8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888074ee8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888074ee8100: fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb ffff888074ee8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================