loop0: detected capacity change from 0 to 512 EXT4-fs: Ignoring removed bh option EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none. ================================================================== BUG: KASAN: slab-use-after-free in ext4_search_dir+0x1b7/0x1d0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff88806c17f3ed by task syz-executor.0/5525 CPU: 1 PID: 5525 Comm: syz-executor.0 Not tainted 6.6.0-rc7-next-20231025-syzkaller-14992-gfe1998aa935b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc3/0x620 mm/kasan/report.c:475 kasan_report+0xd9/0x110 mm/kasan/report.c:588 ext4_search_dir+0x1b7/0x1d0 fs/ext4/namei.c:1543 ext4_find_inline_entry+0x432/0x4f0 fs/ext4/inline.c:1694 __ext4_find_entry+0x85e/0x1050 fs/ext4/namei.c:1616 ext4_lookup_entry fs/ext4/namei.c:1771 [inline] ext4_lookup+0x543/0x740 fs/ext4/namei.c:1839 lookup_open.isra.0+0x924/0x13b0 fs/namei.c:3455 open_last_lookups fs/namei.c:3545 [inline] path_openat+0x933/0x2cd0 fs/namei.c:3775 do_filp_open+0x1dc/0x430 fs/namei.c:3808 do_sys_openat2+0x176/0x1e0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_open fs/open.c:1463 [inline] __se_sys_open fs/open.c:1459 [inline] __x64_sys_open+0x154/0x1e0 fs/open.c:1459 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a RIP: 0033:0x7f02aa07cae9 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:00007f02aadc60c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f02aa19bf80 RCX: 00007f02aa07cae9 RDX: 0000000000000000 RSI: 0000000000141042 RDI: 0000000020000100 RBP: 00007f02aa0c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f02aa19bf80 R15: 00007fffd851a838 Allocated by task 5069: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x24/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] batadv_hardif_add_interface net/batman-adv/hard-interface.c:882 [inline] batadv_hard_if_event+0xbbc/0x1660 net/batman-adv/hard-interface.c:970 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x130 net/core/dev.c:1965 call_netdevice_notifiers_extack net/core/dev.c:2003 [inline] call_netdevice_notifiers net/core/dev.c:2017 [inline] register_netdevice+0xf98/0x14a0 net/core/dev.c:10197 veth_newlink+0x4ef/0xa00 drivers/net/veth.c:1946 rtnl_newlink_create net/core/rtnetlink.c:3521 [inline] __rtnl_newlink+0x1173/0x1930 net/core/rtnetlink.c:3741 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3754 rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6471 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x939/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2194 __do_sys_sendto net/socket.c:2206 [inline] __se_sys_sendto net/socket.c:2202 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2202 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a Freed by task 779: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x24/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] kmem_cache_free_bulk.part.0+0x24f/0x520 mm/slub.c:3927 kfree_bulk include/linux/slab.h:517 [inline] kvfree_rcu_bulk+0x41d/0x540 kernel/rcu/tree.c:2976 kvfree_rcu_drain_ready kernel/rcu/tree.c:3150 [inline] kfree_rcu_monitor+0x47b/0x12d0 kernel/rcu/tree.c:3168 process_one_work+0x8a2/0x15e0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b6/0x1280 kernel/workqueue.c:2784 kthread+0x337/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3386 batadv_hardif_release+0xa4/0xd0 net/batman-adv/hard-interface.c:56 kref_put include/linux/kref.h:65 [inline] batadv_hardif_put net/batman-adv/hard-interface.h:95 [inline] batadv_hardif_put net/batman-adv/hard-interface.h:90 [inline] batadv_hard_if_event+0x1152/0x1660 net/batman-adv/hard-interface.c:1020 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x130 net/core/dev.c:1965 call_netdevice_notifiers_extack net/core/dev.c:2003 [inline] call_netdevice_notifiers net/core/dev.c:2017 [inline] unregister_netdevice_many_notify+0x858/0x1980 net/core/dev.c:10983 unregister_netdevice_many net/core/dev.c:11039 [inline] default_device_exit_batch+0x584/0x740 net/core/dev.c:11508 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 cleanup_net+0x505/0xb20 net/core/net_namespace.c:614 process_one_work+0x8a2/0x15e0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b6/0x1280 kernel/workqueue.c:2784 kthread+0x337/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff88806c17f000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 1005 bytes inside of freed 1024-byte region [ffff88806c17f000, ffff88806c17f400) The buggy address belongs to the physical page: page:ffffea0001b05e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88806c178000 pfn:0x6c178 head:ffffea0001b05e00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888013041dc0 ffffea00009eea10 ffffea000143f610 raw: ffff88806c178000 0000000000100003 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5069, tgid 5069 (syz-executor.0), ts 75622346089, free_ts 25293823800 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa16/0x3680 mm/page_alloc.c:3348 __alloc_pages+0x1cf/0x4c0 mm/page_alloc.c:4604 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8bf/0x1570 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc_node+0x56/0x130 mm/slab_common.c:1014 kmalloc_node include/linux/slab.h:620 [inline] kzalloc_node include/linux/slab.h:732 [inline] qdisc_alloc+0xb3/0xa90 net/sched/sch_generic.c:939 qdisc_create_dflt+0x73/0x3f0 net/sched/sch_generic.c:997 attach_one_default_qdisc net/sched/sch_generic.c:1160 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2534 [inline] attach_default_qdiscs net/sched/sch_generic.c:1178 [inline] dev_activate+0x66c/0x1310 net/sched/sch_generic.c:1237 __dev_open+0x383/0x4d0 net/core/dev.c:1454 dev_open net/core/dev.c:1481 [inline] dev_open+0xec/0x150 net/core/dev.c:1474 bond_enslave+0xa36/0x5cf0 drivers/net/bonding/bond_main.c:2004 do_set_master+0x1c1/0x220 net/core/rtnetlink.c:2710 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2383 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2523 free_contig_range+0xb6/0x190 mm/page_alloc.c:6572 destroy_args+0x7c9/0xa10 mm/debug_vm_pgtable.c:1028 debug_vm_pgtable+0x1d4e/0x40e0 mm/debug_vm_pgtable.c:1408 do_one_initcall+0x128/0x670 init/main.c:1232 do_initcall_level init/main.c:1294 [inline] do_initcalls init/main.c:1310 [inline] do_basic_setup init/main.c:1329 [inline] kernel_init_freeable+0x5bc/0x8f0 init/main.c:1547 kernel_init+0x1c/0x2a0 init/main.c:1437 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Memory state around the buggy address: ffff88806c17f280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806c17f300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806c17f380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806c17f400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806c17f480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================