================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1221 Read of size 1 at addr ffff88810f008d1b by task syz-executor322/302 CPU: 1 PID: 302 Comm: syz-executor322 Not tainted 5.10.226-syzkaller-00001-g6a01908517df #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1221 ext4_dx_readdir fs/ext4/dir.c:598 [inline] ext4_readdir+0x2dde/0x37c0 fs/ext4/dir.c:142 iterate_dir+0x265/0x580 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f858a5831a3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 22 b3 fa ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 b0 ff ff ff f7 d8 RSP: 002b:00007ffcb21681b8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000055555d78c770 RCX: 00007f858a5831a3 RDX: 0000000000008000 RSI: 000055555d78c770 RDI: 0000000000000004 RBP: 000055555d78c744 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffb0 R13: 0000000000000010 R14: 000055555d78c740 R15: 0000000000000001 Allocated by task 306: 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:430 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:463 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 kmem_cache_alloc_node include/linux/slab.h:423 [inline] __alloc_skb+0x80/0x510 net/core/skbuff.c:200 __napi_alloc_skb+0x15d/0x2e0 net/core/skbuff.c:522 napi_alloc_skb include/linux/skbuff.h:2951 [inline] page_to_skb+0x3d/0x900 drivers/net/virtio_net.c:412 receive_mergeable drivers/net/virtio_net.c:1019 [inline] receive_buf+0xe79/0x53d0 drivers/net/virtio_net.c:1129 virtnet_receive drivers/net/virtio_net.c:1421 [inline] virtnet_poll+0x5df/0x1240 drivers/net/virtio_net.c:1530 napi_poll net/core/dev.c:6854 [inline] net_rx_action+0x516/0x10d0 net/core/dev.c:6924 __do_softirq+0x268/0x5bb kernel/softirq.c:309 Freed by task 306: 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+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kmem_cache_free+0xa9/0x1e0 mm/slub.c:3219 kfree_skbmem+0x104/0x170 __kfree_skb+0x58/0x70 net/core/skbuff.c:695 tcp_rcv_established+0xd80/0x1a90 net/ipv4/tcp_input.c:5886 tcp_v4_do_rcv+0x3d7/0x7d0 net/ipv4/tcp_ipv4.c:1695 tcp_v4_rcv+0x23a8/0x2930 net/ipv4/tcp_ipv4.c:2091 ip_protocol_deliver_rcu+0x2f4/0x650 net/ipv4/ip_input.c:204 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] ip_local_deliver+0x2c6/0x590 net/ipv4/ip_input.c:252 dst_input include/net/dst.h:443 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:557 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:608 [inline] ip_sublist_rcv+0x7e2/0x990 net/ipv4/ip_input.c:616 ip_list_rcv+0x422/0x470 net/ipv4/ip_input.c:651 __netif_receive_skb_list_ptype net/core/dev.c:5425 [inline] __netif_receive_skb_list_core+0x6b1/0x890 net/core/dev.c:5473 __netif_receive_skb_list net/core/dev.c:5525 [inline] netif_receive_skb_list_internal+0x967/0xcc0 net/core/dev.c:5635 gro_normal_list net/core/dev.c:5789 [inline] napi_complete_done+0x344/0x750 net/core/dev.c:6538 virtqueue_napi_complete drivers/net/virtio_net.c:357 [inline] virtnet_poll+0xb8a/0x1240 drivers/net/virtio_net.c:1537 napi_poll net/core/dev.c:6854 [inline] net_rx_action+0x516/0x10d0 net/core/dev.c:6924 __do_softirq+0x268/0x5bb kernel/softirq.c:309 The buggy address belongs to the object at ffff88810f008c80 which belongs to the cache skbuff_head_cache of size 248 The buggy address is located 155 bytes inside of 248-byte region [ffff88810f008c80, ffff88810f008d78) The buggy address belongs to the page: page:ffffea00043c0200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10f008 flags: 0x4000000000000200(slab) raw: 4000000000000200 0000000000000000 0000000a00000001 ffff888107d9c600 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 99, ts 4193666167, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:2960 kmem_cache_alloc_node include/linux/slab.h:423 [inline] __alloc_skb+0x80/0x510 net/core/skbuff.c:200 alloc_skb include/linux/skbuff.h:1126 [inline] alloc_skb_with_frags+0xa1/0x570 net/core/skbuff.c:5951 sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2388 unix_dgram_sendmsg+0x700/0x1f90 net/unix/af_unix.c:1725 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] sock_write_iter+0x39b/0x530 net/socket.c:1018 call_write_iter include/linux/fs.h:2021 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb4c/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 page_owner free stack trace missing Memory state around the buggy address: ffff88810f008c00: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc ffff88810f008c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810f008d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ^ ffff88810f008d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88810f008e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop2): __ext4_get_inode_loc:4437: comm syz-executor322: Invalid inode table block 14875662660405297151 in block_group 0 EXT4-fs error (device loop2) in ext4_reserve_inode_write:5897: Corrupt filesystem EXT4-fs error (device loop2): ext4_dirty_inode:6107: inode #2: comm syz-executor322: mark_inode_dirty error