================================================================== BUG: KASAN: use-after-free in ocfs2_lock_global_qf+0xb4/0x2a0 fs/ocfs2/quota_global.c:303 Read of size 8 at addr ffff88807634f828 by task syz.1.17/4283 CPU: 1 PID: 4283 Comm: syz.1.17 Not tainted 5.15.176-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 ocfs2_lock_global_qf+0xb4/0x2a0 fs/ocfs2/quota_global.c:303 ocfs2_get_next_id+0x21c/0x710 fs/ocfs2/quota_global.c:888 dquot_get_next_dqblk+0x6e/0x3a0 fs/quota/dquot.c:2710 quota_getnextquota+0x2bc/0x6b0 fs/quota/quota.c:249 __do_sys_quotactl fs/quota/quota.c:959 [inline] __se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:915 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:0x7f538c59fd29 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:00007f538a410038 EFLAGS: 00000246 ORIG_RAX: 00000000000000b3 RAX: ffffffffffffffda RBX: 00007f538c78ffa0 RCX: 00007f538c59fd29 RDX: 000000000000ee01 RSI: 00000000200080c0 RDI: ffffffff80000901 RBP: 00007f538c61bb08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f538c78ffa0 R15: 00007ffe35afd6e8 Allocated by task 4283: 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_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] ocfs2_local_read_info+0x1ea/0x19e0 fs/ocfs2/quota_local.c:696 dquot_load_quota_sb+0x754/0xb90 fs/quota/dquot.c:2463 dquot_load_quota_inode+0x318/0x600 fs/quota/dquot.c:2500 ocfs2_enable_quotas+0x221/0x440 fs/ocfs2/super.c:927 ocfs2_fill_super+0x4423/0x5890 fs/ocfs2/super.c:1140 mount_bdev+0x2c9/0x3f0 fs/super.c:1400 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x2ba/0xb40 fs/namespace.c:3012 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540 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 4283: 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] kfree+0xf1/0x270 mm/slub.c:4559 ocfs2_local_free_info+0x813/0x990 fs/ocfs2/quota_local.c:869 dquot_disable+0x1111/0x1c60 fs/quota/dquot.c:2309 dquot_suspend include/linux/quotaops.h:84 [inline] ocfs2_susp_quotas+0x247/0x340 fs/ocfs2/super.c:893 ocfs2_remount+0x56e/0xc30 fs/ocfs2/super.c:648 reconfigure_super+0x43a/0x870 fs/super.c:938 do_remount fs/namespace.c:2668 [inline] path_mount+0xceb/0x10a0 fs/namespace.c:3334 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540 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 ffff88807634f800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 40 bytes inside of 1024-byte region [ffff88807634f800, ffff88807634fc00) The buggy address belongs to the page: page:ffffea0001d8d200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76348 head:ffffea0001d8d200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888017441dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1f2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_MEMALLOC|__GFP_HARDWALL), pid 154, ts 70628217250, free_ts 70622750620 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] __kmalloc_node_track_caller+0x1f6/0x390 mm/slub.c:4958 kmalloc_reserve net/core/skbuff.c:356 [inline] __alloc_skb+0x12c/0x590 net/core/skbuff.c:427 __netdev_alloc_skb+0xfb/0x4e0 net/core/skbuff.c:494 __netdev_alloc_skb_ip_align include/linux/skbuff.h:3021 [inline] netdev_alloc_skb_ip_align include/linux/skbuff.h:3031 [inline] batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:559 [inline] batadv_iv_ogm_queue_add+0x6a0/0xbe0 net/batman-adv/bat_iv_ogm.c:671 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:850 [inline] batadv_iv_ogm_schedule+0xb7e/0x1000 net/batman-adv/bat_iv_ogm.c:869 batadv_iv_send_outstanding_bat_ogm_packet+0x6fa/0x800 net/batman-adv/bat_iv_ogm.c:1713 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 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_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3506 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 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 ocfs2_alloc_inode+0x19/0x70 fs/ocfs2/super.c:550 alloc_inode fs/inode.c:236 [inline] iget5_locked+0x9c/0x260 fs/inode.c:1238 ocfs2_iget+0x2c9/0x1f90 fs/ocfs2/inode.c:147 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:142 [inline] ocfs2_get_system_file_inode+0x353/0x7b0 fs/ocfs2/sysfile.c:112 ocfs2_init_local_system_inodes fs/ocfs2/super.c:488 [inline] ocfs2_mount_volume+0x2f7/0x19e0 fs/ocfs2/super.c:1816 ocfs2_fill_super+0x34ec/0x5890 fs/ocfs2/super.c:1083 Memory state around the buggy address: ffff88807634f700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807634f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807634f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807634f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807634f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================