================================================================== BUG: KASAN: use-after-free in ocfs2_lock_global_qf+0xb4/0x2a0 fs/ocfs2/quota_global.c:303 Read of size 8 at addr ffff88807b06b028 by task syz.2.3/4346 CPU: 1 PID: 4346 Comm: syz.2.3 Not tainted 6.1.124-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/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:427 kasan_report+0x136/0x160 mm/kasan/report.c:531 ocfs2_lock_global_qf+0xb4/0x2a0 fs/ocfs2/quota_global.c:303 ocfs2_get_next_id+0x24d/0x7a0 fs/ocfs2/quota_global.c:888 dquot_get_next_dqblk+0x6e/0x3a0 fs/quota/dquot.c:2717 quota_getnextquota+0x2bc/0x6b0 fs/quota/quota.c:250 __do_sys_quotactl fs/quota/quota.c:960 [inline] __se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:916 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f8420385d29 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:00007f842116f038 EFLAGS: 00000246 ORIG_RAX: 00000000000000b3 RAX: ffffffffffffffda RBX: 00007f8420575fa0 RCX: 00007f8420385d29 RDX: 000000000000ee01 RSI: 00000000200080c0 RDI: ffffffff80000901 RBP: 00007f8420401b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8420575fa0 R15: 00007ffef678d068 Allocated by task 4346: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:563 [inline] ocfs2_local_read_info+0x1ea/0x19e0 fs/ocfs2/quota_local.c:696 dquot_load_quota_sb+0x754/0xb90 fs/quota/dquot.c:2470 dquot_load_quota_inode+0x318/0x600 fs/quota/dquot.c:2507 ocfs2_enable_quotas+0x221/0x440 fs/ocfs2/super.c:926 ocfs2_fill_super+0x4c6a/0x5720 fs/ocfs2/super.c:1139 mount_bdev+0x2c9/0x3f0 fs/super.c:1443 legacy_get_tree+0xeb/0x180 fs/fs_context.c:632 vfs_get_tree+0x88/0x270 fs/super.c:1573 do_new_mount+0x2ba/0xb40 fs/namespace.c:3056 do_mount fs/namespace.c:3399 [inline] __do_sys_mount fs/namespace.c:3607 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3584 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 4346: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674 ocfs2_local_free_info+0x813/0x990 fs/ocfs2/quota_local.c:869 dquot_disable+0x110f/0x1c50 fs/quota/dquot.c:2316 dquot_suspend include/linux/quotaops.h:85 [inline] ocfs2_susp_quotas+0x247/0x340 fs/ocfs2/super.c:892 ocfs2_remount+0x56e/0xc30 fs/ocfs2/super.c:647 reconfigure_super+0x43a/0x870 fs/super.c:977 do_remount fs/namespace.c:2712 [inline] path_mount+0xe69/0x1090 fs/namespace.c:3378 do_mount fs/namespace.c:3399 [inline] __do_sys_mount fs/namespace.c:3607 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3584 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88807b06b000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 40 bytes inside of 1024-byte region [ffff88807b06b000, ffff88807b06b400) The buggy address belongs to the physical page: page:ffffea0001ec1a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b068 head:ffffea0001ec1a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888017c41dc0 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 0x152a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 46, tgid 46 (kworker/u4:3), ts 80393169096, free_ts 71510522195 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4328 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5605 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc+0xa1/0x230 mm/slab_common.c:949 kmalloc include/linux/slab.h:568 [inline] kzalloc include/linux/slab.h:699 [inline] ieee802_11_parse_elems_full+0xc4/0x1380 net/mac80211/util.c:1503 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2248 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2255 [inline] ieee80211_bss_info_update+0x99f/0xf00 net/mac80211/scan.c:212 ieee80211_rx_bss_info net/mac80211/ibss.c:1120 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1609 [inline] ieee80211_ibss_rx_queued_mgmt+0x1962/0x2dd0 net/mac80211/ibss.c:1638 ieee80211_iface_process_skb net/mac80211/iface.c:1668 [inline] ieee80211_iface_work+0x7aa/0xce0 net/mac80211/iface.c:1722 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x12a6/0x15b0 mm/page_alloc.c:3384 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3479 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] __kmem_cache_alloc_node+0x137/0x260 mm/slub.c:3437 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:699 [inline] ref_tracker_alloc+0x13c/0x470 lib/ref_tracker.c:85 __netdev_tracker_alloc include/linux/netdevice.h:4043 [inline] netdev_hold include/linux/netdevice.h:4072 [inline] rx_queue_add_kobject net/core/net-sysfs.c:1058 [inline] net_rx_queue_update_kobjects+0x14d/0x4c0 net/core/net-sysfs.c:1112 register_queue_kobjects net/core/net-sysfs.c:1772 [inline] netdev_register_kobject+0x222/0x310 net/core/net-sysfs.c:2017 register_netdevice+0x11ec/0x1920 net/core/dev.c:10161 bond_newlink+0x37/0x80 drivers/net/bonding/bond_netlink.c:565 rtnl_newlink_create net/core/rtnetlink.c:3419 [inline] __rtnl_newlink net/core/rtnetlink.c:3639 [inline] rtnl_newlink+0x14e3/0x2050 net/core/rtnetlink.c:3652 rtnetlink_rcv_msg+0x818/0xff0 net/core/rtnetlink.c:6150 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2493 Memory state around the buggy address: ffff88807b06af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b06af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807b06b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807b06b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807b06b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================