================================================================== BUG: KASAN: slab-out-of-bounds in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1515 Read of size 1 at addr ffff88811d4056e3 by task syz-executor.0/366 CPU: 0 PID: 366 Comm: syz-executor.0 Not tainted 5.10.218-syzkaller-1002634-g3feee789f446 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1515 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1700 __ext4_find_entry+0x2b0/0x1990 fs/ext4/namei.c:1588 ext4_lookup_entry fs/ext4/namei.c:1743 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1811 lookup_open fs/namei.c:3226 [inline] open_last_lookups fs/namei.c:3317 [inline] path_openat+0x11ab/0x3000 fs/namei.c:3506 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x6f0 fs/open.c:1217 do_sys_open fs/open.c:1233 [inline] __do_sys_openat fs/open.c:1249 [inline] __se_sys_openat fs/open.c:1244 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1244 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f2da92fbe69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2da8e7d0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f2da9429f80 RCX: 00007f2da92fbe69 RDX: 000000000000275a RSI: 0000000020000280 RDI: ffffffffffffff9c RBP: 00007f2da934847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f2da9429f80 R15: 00007ffcd7f01348 Allocated by task 0: (stack is not available) Freed by task 329: 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] kfree+0xc3/0x270 mm/slub.c:4191 skb_free_head net/core/skbuff.c:606 [inline] skb_release_data+0x5c6/0x6f0 net/core/skbuff.c:626 skb_release_all net/core/skbuff.c:680 [inline] __kfree_skb net/core/skbuff.c:694 [inline] kfree_skb_partial+0x6e/0x90 net/core/skbuff.c:5227 tcp_rcv_established+0x11f3/0x1a90 net/ipv4/tcp_input.c:5931 tcp_v4_do_rcv+0x3d7/0x7d0 net/ipv4/tcp_ipv4.c:1695 tcp_v4_rcv+0x23a8/0x2930 net/ipv4/tcp_ipv4.c:2082 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+0xb60/0x11f0 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 ffff88811d405000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 739 bytes to the right of 1024-byte region [ffff88811d405000, ffff88811d405400) The buggy address belongs to the page: page:ffffea0004750000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d400 head:ffffea0004750000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00 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 329, ts 50129303339, free_ts 50124262714 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] __kmalloc_track_caller+0x1f8/0x320 mm/slub.c:4536 __kmalloc_reserve net/core/skbuff.c:144 [inline] __alloc_skb+0xbc/0x510 net/core/skbuff.c:212 __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+0x5cf/0x11f0 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 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] __free_pages_ok+0x82c/0x850 mm/page_alloc.c:1629 free_compound_page+0x73/0x90 mm/page_alloc.c:710 destroy_compound_page include/linux/mm.h:959 [inline] __put_compound_page+0x73/0xb0 mm/swap.c:117 __put_page+0xc0/0xe0 mm/swap.c:133 put_page include/linux/mm.h:1257 [inline] __skb_frag_unref include/linux/skbuff.h:3100 [inline] skb_release_data+0x240/0x6f0 net/core/skbuff.c:620 skb_release_all net/core/skbuff.c:680 [inline] __kfree_skb+0x50/0x70 net/core/skbuff.c:694 sk_eat_skb include/net/sock.h:2644 [inline] tcp_recvmsg+0x1765/0x3590 net/ipv4/tcp.c:2345 inet_recvmsg+0x158/0x500 net/ipv4/af_inet.c:855 sock_recvmsg_nosec net/socket.c:905 [inline] sock_recvmsg net/socket.c:923 [inline] sock_read_iter+0x353/0x480 net/socket.c:996 call_read_iter include/linux/fs.h:2015 [inline] new_sync_read fs/read_write.c:415 [inline] vfs_read+0x999/0xbb0 fs/read_write.c:496 ksys_read+0x199/0x2c0 fs/read_write.c:634 __do_sys_read fs/read_write.c:644 [inline] __se_sys_read fs/read_write.c:642 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:642 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88811d405580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811d405600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811d405680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88811d405700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811d405780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== EXT4-fs error (device loop0): ext4_find_dest_de:2076: inode #12: block 5: comm syz-executor.0: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=1375716473, rec_len=40042, size=56 fake=0