================================================================== BUG: KASAN: slab-use-after-free in rose_get_neigh+0x1b6/0x6f0 net/rose/rose_route.c:692 Read of size 1 at addr ffff88805caa8830 by task syz-executor.0/10244 CPU: 0 PID: 10244 Comm: syz-executor.0 Not tainted 6.9.0-rc7-syzkaller-01795-g383eed2de529 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 rose_get_neigh+0x1b6/0x6f0 net/rose/rose_route.c:692 rose_connect+0x45a/0x1170 net/rose/af_rose.c:808 __sys_connect_file net/socket.c:2048 [inline] __sys_connect+0x2df/0x310 net/socket.c:2065 __do_sys_connect net/socket.c:2075 [inline] __se_sys_connect net/socket.c:2072 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2072 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe8d8c7dd69 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:00007fe8d9a4f0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007fe8d8dabf80 RCX: 00007fe8d8c7dd69 RDX: 000000000000001c RSI: 00000000200003c0 RDI: 0000000000000005 RBP: 00007fe8d8cca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000004d R14: 00007fe8d8dabf80 R15: 00007ffe304429b8 Allocated by task 9743: 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:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3972 [inline] __kmalloc+0x233/0x4a0 mm/slub.c:3985 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] fib6_info_alloc+0x2e/0xf0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x445/0x12b0 net/ipv6/route.c:3759 ip6_route_add+0x28/0x160 net/ipv6/route.c:3851 addrconf_add_mroute net/ipv6/addrconf.c:2549 [inline] addrconf_add_dev+0x35b/0x540 net/ipv6/addrconf.c:2567 addrconf_dev_config net/ipv6/addrconf.c:3481 [inline] addrconf_init_auto_addrs+0x85f/0xeb0 net/ipv6/addrconf.c:3569 addrconf_notify+0xaff/0x1020 net/ipv6/addrconf.c:3742 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 __dev_notify_flags+0x207/0x400 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8858 do_setlink+0xccd/0x41f0 net/core/rtnetlink.c:2900 __rtnl_newlink net/core/rtnetlink.c:3696 [inline] rtnl_newlink+0x180b/0x20a0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x89b/0x10d0 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2191 __do_sys_sendto net/socket.c:2203 [inline] __se_sys_sendto net/socket.c:2199 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2199 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 15: 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:579 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2111 [inline] slab_free mm/slub.c:4286 [inline] kfree+0x153/0x3b0 mm/slub.c:4396 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2471 handle_softirqs+0x2d6/0x990 kernel/softirq.c:554 run_ksoftirqd+0xca/0x130 kernel/softirq.c:928 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 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+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:2734 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2838 call_rcu_hurry include/linux/rcupdate.h:114 [inline] fib6_info_release include/net/ip6_fib.h:343 [inline] fib6_del_route net/ipv6/ip6_fib.c:2010 [inline] fib6_del+0x114b/0x1600 net/ipv6/ip6_fib.c:2043 fib6_clean_node+0x2f7/0x5e0 net/ipv6/ip6_fib.c:2205 fib6_walk_continue+0x658/0x8f0 net/ipv6/ip6_fib.c:2127 fib6_walk+0x168/0x2b0 net/ipv6/ip6_fib.c:2175 fib6_clean_tree net/ipv6/ip6_fib.c:2255 [inline] __fib6_clean_all+0x31f/0x4b0 net/ipv6/ip6_fib.c:2271 rt6_sync_down_dev net/ipv6/route.c:4903 [inline] rt6_disable_ip+0x170/0x890 net/ipv6/route.c:4908 addrconf_ifdown+0x15d/0x1bc0 net/ipv6/addrconf.c:3855 addrconf_notify+0x3cb/0x1020 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2031 [inline] call_netdevice_notifiers net/core/dev.c:2045 [inline] dev_close_many+0x33c/0x4c0 net/core/dev.c:1586 unregister_netdevice_many_notify+0x544/0x16e0 net/core/dev.c:11202 cleanup_net+0x75d/0xcc0 net/core/net_namespace.c:635 process_one_work kernel/workqueue.c:3267 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3348 worker_thread+0x86d/0xd70 kernel/workqueue.c:3429 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88805caa8800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 48 bytes inside of freed 512-byte region [ffff88805caa8800, ffff88805caa8a00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805caaa400 pfn:0x5caa8 head: order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000a40(workingset|slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000a40 ffff888015041c80 ffffea0001e98310 ffffea0001eaa610 raw: ffff88805caaa400 000000000010000c 00000001ffffffff 0000000000000000 head: 00fff00000000a40 ffff888015041c80 ffffea0001e98310 ffffea0001eaa610 head: ffff88805caaa400 000000000010000c 00000001ffffffff 0000000000000000 head: 00fff00000000002 ffffea000172aa01 dead000000000122 00000000ffffffff head: 0000000400000000 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 6959, tgid -440330124 (syz-executor.1), ts 6959, free_ts 149622478589 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3410/0x35b0 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6c0 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2180 allocate_slab mm/slub.c:2343 [inline] new_slab+0x84/0x2f0 mm/slub.c:2396 ___slab_alloc+0xc73/0x1260 mm/slub.c:3530 __slab_alloc mm/slub.c:3615 [inline] __slab_alloc_node mm/slub.c:3668 [inline] slab_alloc_node mm/slub.c:3841 [inline] __do_kmalloc_node mm/slub.c:3971 [inline] __kmalloc+0x2e5/0x4a0 mm/slub.c:3985 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] fib6_info_alloc+0x2e/0xf0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x445/0x12b0 net/ipv6/route.c:3759 ip6_route_add+0x28/0x160 net/ipv6/route.c:3851 addrconf_prefix_route net/ipv6/addrconf.c:2485 [inline] fixup_permanent_addr net/ipv6/addrconf.c:3600 [inline] addrconf_permanent_addr+0x7c4/0xc50 net/ipv6/addrconf.c:3624 addrconf_notify+0x9f5/0x1020 net/ipv6/addrconf.c:3696 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 __dev_notify_flags+0x207/0x400 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8858 do_setlink+0xccd/0x41f0 net/core/rtnetlink.c:2900 page last free pid 6924 tgid 6924 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x986/0xab0 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 discard_slab mm/slub.c:2442 [inline] __put_partials+0xeb/0x130 mm/slub.c:2911 put_cpu_partial+0x17c/0x250 mm/slub.c:2986 __slab_free+0x2ea/0x3d0 mm/slub.c:4157 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3804 [inline] slab_alloc_node mm/slub.c:3851 [inline] kmem_cache_alloc_node+0x194/0x390 mm/slub.c:3894 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:656 alloc_skb include/linux/skbuff.h:1308 [inline] nlmsg_new include/net/netlink.h:1015 [inline] netlink_ack+0x13f/0xa30 net/netlink/af_netlink.c:2501 netlink_rcv_skb+0x262/0x430 net/netlink/af_netlink.c:2570 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2191 Memory state around the buggy address: ffff88805caa8700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805caa8780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805caa8800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805caa8880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805caa8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================