================================================================== BUG: KASAN: slab-use-after-free in rose_get_neigh+0x1b6/0x6f0 net/rose/rose_route.c:692 Read of size 1 at addr ffff888030947c30 by task syz.3.4040/19365 CPU: 0 UID: 0 PID: 19365 Comm: syz.3.4040 Not tainted 6.14.0-rc6-syzkaller-01216-gbfc6c67ec2d6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 rose_get_neigh+0x1b6/0x6f0 net/rose/rose_route.c:692 rose_connect+0x45a/0x1170 net/rose/af_rose.c:816 __sys_connect_file net/socket.c:2036 [inline] __sys_connect+0x288/0x2d0 net/socket.c:2055 __do_sys_connect net/socket.c:2061 [inline] __se_sys_connect net/socket.c:2058 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2058 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f20a3b8d169 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:00007f20a4a34038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007f20a3da6080 RCX: 00007f20a3b8d169 RDX: 000000000000001c RSI: 0000400000000180 RDI: 000000000000000d RBP: 00007f20a3c0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f20a3da6080 R15: 00007fff820eff68 Allocated by task 10229: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_noprof+0x285/0x4c0 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] fib6_info_alloc+0x2e/0xf0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x445/0x12b0 net/ipv6/route.c:3766 ip6_route_add+0x28/0x160 net/ipv6/route.c:3858 addrconf_prefix_route net/ipv6/addrconf.c:2485 [inline] addrconf_add_linklocal+0x61a/0xa30 net/ipv6/addrconf.c:3307 addrconf_addr_gen+0x510/0xbb0 addrconf_init_auto_addrs+0x7f7/0xfb0 addrconf_notify+0xaff/0x1020 net/ipv6/addrconf.c:3739 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 netdev_state_change+0x11f/0x1a0 net/core/dev.c:1544 linkwatch_do_dev+0x112/0x170 net/core/link_watch.c:186 __linkwatch_run_queue+0x44f/0x6c0 net/core/link_watch.c:243 linkwatch_event+0x4c/0x60 net/core/link_watch.c:286 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 25: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x196/0x430 mm/slub.c:4757 rcu_do_batch kernel/rcu/tree.c:2546 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2802 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xaa/0xc0 mm/kasan/generic.c:548 __call_rcu_common kernel/rcu/tree.c:3065 [inline] call_rcu+0x168/0xac0 kernel/rcu/tree.c:3172 call_rcu_hurry include/linux/rcupdate.h:115 [inline] fib6_info_release include/net/ip6_fib.h:343 [inline] fib6_del_route net/ipv6/ip6_fib.c:2007 [inline] fib6_del+0x1142/0x1600 net/ipv6/ip6_fib.c:2040 fib6_clean_node+0x2f7/0x5e0 net/ipv6/ip6_fib.c:2202 fib6_walk_continue+0x658/0x8f0 net/ipv6/ip6_fib.c:2124 fib6_walk+0x168/0x2b0 net/ipv6/ip6_fib.c:2172 fib6_clean_tree net/ipv6/ip6_fib.c:2252 [inline] __fib6_clean_all+0x31f/0x4b0 net/ipv6/ip6_fib.c:2268 rt6_sync_down_dev net/ipv6/route.c:4913 [inline] rt6_disable_ip+0x170/0x800 net/ipv6/route.c:4918 addrconf_ifdown+0x15d/0x1b00 net/ipv6/addrconf.c:3852 addrconf_notify+0x3cb/0x1020 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2226 [inline] call_netdevice_notifiers net/core/dev.c:2240 [inline] dev_close_many+0x33c/0x4c0 net/core/dev.c:1746 unregister_netdevice_many_notify+0x629/0x24f0 net/core/dev.c:11923 unregister_netdevice_many net/core/dev.c:12018 [inline] default_device_exit_batch+0x7fd/0x880 net/core/dev.c:12508 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x8ad/0xd60 net/core/net_namespace.c:652 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888030947c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 48 bytes inside of freed 512-byte region [ffff888030947c00, ffff888030947e00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x30944 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b041c80 ffffea0000d57700 dead000000000003 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b041c80 ffffea0000d57700 dead000000000003 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000c25101 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 3004, tgid 3004 (kworker/u8:7), ts 88080979368, free_ts 88002725319 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4740 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __kmalloc_cache_noprof+0x27b/0x390 mm/slub.c:4320 kmalloc_noprof include/linux/slab.h:901 [inline] batadv_forw_packet_alloc+0x19c/0x3b0 net/batman-adv/send.c:519 batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:562 [inline] batadv_iv_ogm_queue_add+0x6f6/0xc10 net/batman-adv/bat_iv_ogm.c:670 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:849 [inline] batadv_iv_ogm_schedule+0xc53/0x10a0 net/batman-adv/bat_iv_ogm.c:868 batadv_iv_send_outstanding_bat_ogm_packet+0x6fe/0x810 net/batman-adv/bat_iv_ogm.c:1712 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 page last free pid 2915 tgid 2915 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe0d/0x10e0 mm/page_alloc.c:2660 __folio_put+0x2b3/0x360 mm/swap.c:112 folio_put include/linux/mm.h:1489 [inline] free_large_kmalloc+0xfe/0x180 mm/slub.c:4728 build_detached_freelist+0x21d/0x260 mm/slub.c:4915 kmem_cache_free_bulk+0xc5/0x530 mm/slub.c:4993 kfree_bulk include/linux/slab.h:790 [inline] kvfree_rcu_bulk+0xd3/0x1d0 mm/slab_common.c:1500 kvfree_rcu_drain_ready mm/slab_common.c:1684 [inline] kfree_rcu_monitor+0x20a/0x2a0 mm/slab_common.c:1757 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888030947b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888030947b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888030947c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888030947c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888030947d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================