EXT4-fs warning (device loop4): dx_probe:892: inode #2: comm syz.4.344: dx entry: limit 0 != root limit 124 EXT4-fs warning (device loop4): dx_probe:965: inode #2: comm syz.4.344: Corrupt directory, running e2fsck is recommended ================================================================== BUG: KASAN: use-after-free in __ext4_check_dir_entry+0x6f3/0x870 fs/ext4/dir.c:85 Read of size 2 at addr ffff88805b62b003 by task syz.4.344/4787 CPU: 1 PID: 4787 Comm: syz.4.344 Not tainted 6.1.97-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 __ext4_check_dir_entry+0x6f3/0x870 fs/ext4/dir.c:85 ext4_readdir+0x139e/0x3950 fs/ext4/dir.c:258 iterate_dir+0x224/0x560 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354 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:0x7f2da2375bd9 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:00007f2da3196048 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f2da2503f60 RCX: 00007f2da2375bd9 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000008 RBP: 00007f2da23e4aa1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f2da2503f60 R15: 00007ffee5106718 Allocated by task 21: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328 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] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422 dst_alloc+0x12c/0x190 net/core/dst.c:88 ip6_dst_alloc net/ipv6/route.c:345 [inline] icmp6_dst_alloc+0x7b/0x470 net/ipv6/route.c:3269 ndisc_send_skb+0x344/0x14e0 net/ipv6/ndisc.c:489 addrconf_rs_timer+0x357/0x610 net/ipv6/addrconf.c:3962 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 call_rcu+0x163/0xa10 kernel/rcu/tree.c:2844 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] skb_scrub_packet+0xdf/0x490 net/core/skbuff.c:5550 geneve_build_skb+0xfe/0x900 drivers/net/geneve.c:783 geneve_xmit_skb drivers/net/geneve.c:1006 [inline] geneve_xmit+0x1509/0x3550 drivers/net/geneve.c:1124 __netdev_start_xmit include/linux/netdevice.h:4853 [inline] netdev_start_xmit include/linux/netdevice.h:4867 [inline] xmit_one net/core/dev.c:3627 [inline] dev_hard_start_xmit+0x261/0x8c0 net/core/dev.c:3643 __dev_queue_xmit+0x1bb1/0x3cf0 net/core/dev.c:4293 dev_queue_xmit include/linux/netdevice.h:3021 [inline] neigh_hh_output include/net/neighbour.h:528 [inline] neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0xea9/0x1530 net/ipv6/ip6_output.c:134 __ip6_finish_output net/ipv6/ip6_output.c:201 [inline] ip6_finish_output+0x6a0/0xa80 net/ipv6/ip6_output.c:212 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] ndisc_send_skb+0xbab/0x14e0 net/ipv6/ndisc.c:509 addrconf_rs_timer+0x357/0x610 net/ipv6/addrconf.c:3962 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 call_rcu+0x163/0xa10 kernel/rcu/tree.c:2844 refdst_drop include/net/dst.h:256 [inline] skb_dst_drop include/net/dst.h:268 [inline] __dev_queue_xmit+0x9cf/0x3cf0 net/core/dev.c:4248 dev_queue_xmit include/linux/netdevice.h:3021 [inline] neigh_hh_output include/net/neighbour.h:528 [inline] neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0xea9/0x1530 net/ipv6/ip6_output.c:134 __ip6_finish_output net/ipv6/ip6_output.c:201 [inline] ip6_finish_output+0x6a0/0xa80 net/ipv6/ip6_output.c:212 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] ndisc_send_skb+0xbab/0x14e0 net/ipv6/ndisc.c:509 addrconf_rs_timer+0x357/0x610 net/ipv6/addrconf.c:3962 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88805b62b000 which belongs to the cache ip6_dst_cache of size 240 The buggy address is located 3 bytes inside of 240-byte region [ffff88805b62b000, ffff88805b62b0f0) The buggy address belongs to the physical page: page:ffffea00016d8ac0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805b62b780 pfn:0x5b62b flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000170d588 ffffea0000876fc8 ffff888027240c80 raw: ffff88805b62b780 00000000000c0001 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 3593, tgid 3593 (kworker/1:6), ts 58939789815, free_ts 11503213290 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4283 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5551 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] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422 dst_alloc+0x12c/0x190 net/core/dst.c:88 ip6_dst_alloc net/ipv6/route.c:345 [inline] icmp6_dst_alloc+0x7b/0x470 net/ipv6/route.c:3269 mld_sendpack+0x6b9/0xde0 net/ipv6/mcast.c:1809 ipv6_mc_dad_complete+0x84/0x390 net/ipv6/mcast.c:2247 addrconf_dad_completed+0x72e/0xcb0 net/ipv6/addrconf.c:4259 addrconf_dad_work+0xd8e/0x16b0 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3362 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3457 free_contig_range+0x9a/0x150 mm/page_alloc.c:9511 destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x416/0x46b mm/debug_vm_pgtable.c:1354 do_one_initcall+0x265/0x8f0 init/main.c:1298 do_initcall_level+0x157/0x207 init/main.c:1371 do_initcalls+0x49/0x86 init/main.c:1387 kernel_init_freeable+0x45c/0x60f init/main.c:1626 kernel_init+0x19/0x290 init/main.c:1514 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff88805b62af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805b62af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805b62b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805b62b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88805b62b100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================