EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbea/0xe30 fs/ext4/extents.c:946 Read of size 4 at addr ffff88811d40c088 by task kworker/u4:0/8 CPU: 0 PID: 8 Comm: kworker/u4:0 Not tainted 5.15.178-syzkaller-1079147-g7d1f9b5c2ff5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch fs/ext4/extents.c:827 [inline] ext4_find_extent+0xbea/0xe30 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x269/0x7450 fs/ext4/extents.c:4165 ext4_map_blocks+0xa60/0x1c70 fs/ext4/inode.c:673 mpage_map_one_extent fs/ext4/inode.c:2420 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2473 [inline] ext4_writepages+0x1628/0x4000 fs/ext4/inode.c:2841 do_writepages+0x40e/0x670 mm/page-writeback.c:2388 __writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1647 writeback_sb_inodes+0xb2a/0x1920 fs/fs-writeback.c:1930 wb_writeback+0x3c8/0x9f0 fs/fs-writeback.c:2106 wb_do_writeback fs/fs-writeback.c:2253 [inline] wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2294 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 321: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc_track_caller+0x13e/0x2c0 mm/slub.c:4954 kmalloc_reserve net/core/skbuff.c:357 [inline] __alloc_skb+0x10c/0x550 net/core/skbuff.c:428 __napi_alloc_skb+0x167/0x2e0 net/core/skbuff.c:569 napi_alloc_skb include/linux/skbuff.h:3079 [inline] page_to_skb+0x2a5/0xb40 drivers/net/virtio_net.c:454 receive_mergeable drivers/net/virtio_net.c:1070 [inline] receive_buf+0xed9/0x5860 drivers/net/virtio_net.c:1180 virtnet_receive drivers/net/virtio_net.c:1472 [inline] virtnet_poll+0x615/0x1250 drivers/net/virtio_net.c:1585 __napi_poll+0xc4/0x5a0 net/core/dev.c:7051 napi_poll net/core/dev.c:7118 [inline] net_rx_action+0x47d/0xc50 net/core/dev.c:7208 handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565 __do_softirq kernel/softirq.c:603 [inline] invoke_softirq kernel/softirq.c:425 [inline] __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:652 irq_exit_rcu+0x9/0x10 kernel/softirq.c:664 common_interrupt+0xc3/0xe0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x27/0x40 arch/x86/include/asm/idtentry.h:667 Freed by task 321: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3521 [inline] kfree+0xcc/0x270 mm/slub.c:4583 skb_free_head net/core/skbuff.c:656 [inline] skb_release_data+0x8a9/0xa80 net/core/skbuff.c:678 skb_release_all net/core/skbuff.c:743 [inline] __kfree_skb net/core/skbuff.c:757 [inline] kfree_skb_partial+0x6e/0x90 net/core/skbuff.c:5455 tcp_rcv_established+0x112f/0x1ac0 net/ipv4/tcp_input.c:6022 tcp_v4_do_rcv+0x3d7/0xa00 net/ipv4/tcp_ipv4.c:1726 tcp_v4_rcv+0x23dd/0x2a70 net/ipv4/tcp_ipv4.c:2138 ip_protocol_deliver_rcu+0x32f/0x710 net/ipv4/ip_input.c:204 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] ip_local_deliver+0x2c6/0x590 net/ipv4/ip_input.c:252 dst_input include/net/dst.h:454 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:577 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:628 [inline] ip_sublist_rcv+0x7e2/0x980 net/ipv4/ip_input.c:636 ip_list_rcv+0x422/0x470 net/ipv4/ip_input.c:671 __netif_receive_skb_list_ptype net/core/dev.c:5544 [inline] __netif_receive_skb_list_core+0x6b1/0x890 net/core/dev.c:5592 __netif_receive_skb_list net/core/dev.c:5644 [inline] netif_receive_skb_list_internal+0x967/0xcc0 net/core/dev.c:5735 gro_normal_list net/core/dev.c:5889 [inline] napi_complete_done+0x344/0x770 net/core/dev.c:6627 virtqueue_napi_complete drivers/net/virtio_net.c:357 [inline] virtnet_poll+0xbd0/0x1250 drivers/net/virtio_net.c:1592 __napi_poll+0xc4/0x5a0 net/core/dev.c:7051 napi_poll net/core/dev.c:7118 [inline] net_rx_action+0x47d/0xc50 net/core/dev.c:7208 handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565 __do_softirq kernel/softirq.c:603 [inline] invoke_softirq kernel/softirq.c:425 [inline] __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:652 irq_exit_rcu+0x9/0x10 kernel/softirq.c:664 common_interrupt+0xc3/0xe0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x27/0x40 arch/x86/include/asm/idtentry.h:667 The buggy address belongs to the object at ffff88811d40c000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 136 bytes inside of 1024-byte region [ffff88811d40c000, ffff88811d40c400) The buggy address belongs to the page: page:ffffea0004750200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d408 head:ffffea0004750200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 0000000000000000 dead000000000122 ffff888100043080 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 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 321, ts 37734513055, free_ts 19181477286 create_dummy_stack mm/page_owner.c:60 [inline] register_dummy_stack+0x86/0xe0 mm/page_owner.c:66 init_page_owner+0x33/0x830 mm/page_owner.c:84 invoke_init_callbacks mm/page_ext.c:116 [inline] page_ext_init+0x3ab/0x3d0 mm/page_ext.c:510 kernel_init_freeable+0x2bc/0x400 init/main.c:1613 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 __put_single_page mm/swap.c:98 [inline] __put_page+0xb0/0xe0 mm/swap.c:129 put_page include/linux/mm.h:1295 [inline] anon_pipe_buf_release+0x187/0x200 fs/pipe.c:137 pipe_buf_release include/linux/pipe_fs_i.h:219 [inline] pipe_read+0x5a6/0x1040 fs/pipe.c:323 call_read_iter include/linux/fs.h:2200 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xa81/0xd40 fs/read_write.c:485 ksys_read+0x199/0x2c0 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 x64_sys_call+0x28/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:1 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 Memory state around the buggy address: ffff88811d40bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811d40c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811d40c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811d40c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811d40c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop0): ext4_map_blocks:739: inode #19: block 188686503247872: comm kworker/u4:0: lblock 0 mapped to illegal pblock 188686503247872 (length 16) EXT4-fs (loop0): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): ext4_ext_map_blocks:4183: inode #19: comm kworker/u4:0: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop0): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs (loop0): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 4 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): ext4_ext_map_blocks:4183: inode #19: comm kworker/u4:0: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop0): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): ext4_ext_map_blocks:4183: inode #19: comm kworker/u4:0: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop0): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): ext4_ext_map_blocks:4183: inode #19: comm kworker/u4:0: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop0): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs error (device loop0): __ext4_get_inode_loc:4351: comm kworker/u4:0: Invalid inode table block 0 in block_group 0