EXT4-fs error (device loop5): ext4_mb_generate_buddy:1098: group 0, block bitmap and bg descriptor inconsistent: 4057 vs 220 free clusters ================================================================== BUG: KASAN: use-after-free in crc16+0x1c0/0x280 lib/crc16.c:58 Read of size 1 at addr ffff88804bc5c000 by task syz-executor.5/24012 CPU: 0 PID: 24012 Comm: syz-executor.5 Not tainted 6.4.0-rc1-syzkaller-00025-gd295b66a7b66 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x163/0x540 mm/kasan/report.c:462 kasan_report+0x176/0x1b0 mm/kasan/report.c:572 crc16+0x1c0/0x280 lib/crc16.c:58 ext4_group_desc_csum+0x90f/0xc50 fs/ext4/super.c:3243 ext4_group_desc_csum_set+0x19b/0x240 fs/ext4/super.c:3266 ext4_mb_clear_bb fs/ext4/mballoc.c:6206 [inline] ext4_free_blocks+0x1ae2/0x2d60 fs/ext4/mballoc.c:6352 ext4_clear_blocks+0x334/0x3a0 fs/ext4/indirect.c:887 ext4_free_data fs/ext4/indirect.c:961 [inline] ext4_ind_truncate+0x76b/0xd60 fs/ext4/indirect.c:1153 ext4_truncate+0x9df/0x1150 fs/ext4/inode.c:4153 ext4_setattr+0x1196/0x1bc0 fs/ext4/inode.c:5434 notify_change+0xc8b/0xf40 fs/attr.c:483 do_truncate+0x220/0x300 fs/open.c:66 handle_truncate fs/namei.c:3295 [inline] do_open fs/namei.c:3640 [inline] path_openat+0x294e/0x3170 fs/namei.c:3791 do_filp_open+0x234/0x490 fs/namei.c:3818 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_open fs/open.c:1380 [inline] __se_sys_open fs/open.c:1376 [inline] __x64_sys_open+0x225/0x270 fs/open.c:1376 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f646a08c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f646ad69168 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f646a1ac1f0 RCX: 00007f646a08c169 RDX: 0000000000000000 RSI: 0000000000000600 RDI: 0000000020000040 RBP: 00007f646a0e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc711a6fef R14: 00007f646ad69300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea00012f1700 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x4bc5c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffff7f(buddy) raw: 00fff00000000000 ffffea0001f3fd08 ffffea0000a7cc08 0000000000000000 raw: 0000000000000000 0000000000000002 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1f2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_MEMALLOC|__GFP_HARDWALL), pid 21, tgid 21 (ksoftirqd/1), ts 613042829097, free_ts 626406912897 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3502 __alloc_pages+0x255/0x670 mm/page_alloc.c:4768 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3192 __slab_alloc mm/slub.c:3291 [inline] __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] kmem_cache_alloc_node+0x1f3/0x350 mm/slub.c:3496 kmalloc_reserve+0x8a/0x240 net/core/skbuff.c:568 __alloc_skb+0x1b1/0x420 net/core/skbuff.c:654 __netdev_alloc_skb+0x105/0x520 net/core/skbuff.c:718 netdev_alloc_skb include/linux/skbuff.h:3194 [inline] dev_alloc_skb include/linux/skbuff.h:3207 [inline] __ieee80211_beacon_get+0x909/0x14f0 net/mac80211/tx.c:5421 ieee80211_beacon_get_tim+0xbd/0x5b0 net/mac80211/tx.c:5543 ieee80211_beacon_get include/net/mac80211.h:5384 [inline] mac80211_hwsim_beacon_tx+0x382/0x750 drivers/net/wireless/virtual/mac80211_hwsim.c:2253 __iterate_interfaces+0x21e/0x4b0 net/mac80211/util.c:766 ieee80211_iterate_active_interfaces_atomic+0xb3/0x140 net/mac80211/util.c:802 mac80211_hwsim_beacon+0xd4/0x1e0 drivers/net/wireless/virtual/mac80211_hwsim.c:2283 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2564 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2659 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711 slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x11f/0x2e0 mm/slub.c:3475 getname_flags+0xbc/0x4e0 fs/namei.c:140 vfs_fstatat fs/stat.c:275 [inline] __do_sys_newfstatat fs/stat.c:446 [inline] __se_sys_newfstatat fs/stat.c:440 [inline] __x64_sys_newfstatat+0x12e/0x1d0 fs/stat.c:440 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88804bc5bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804bc5bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88804bc5c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804bc5c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804bc5c100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================