================================================================== BUG: KASAN: slab-use-after-free in rose_get_neigh+0x1b6/0x6f0 net/rose/rose_route.c:692 Read of size 1 at addr ffff88802e51c430 by task syz.1.4103/15430 CPU: 1 PID: 15430 Comm: syz.1.4103 Not tainted 6.10.0-rc4-syzkaller-00948-gcce346d44139 #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+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:2049 [inline] __sys_connect+0x2df/0x310 net/socket.c:2066 __do_sys_connect net/socket.c:2076 [inline] __se_sys_connect net/socket.c:2073 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2073 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:0x7fd393b75b29 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:00007fd3948cd048 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007fd393d04070 RCX: 00007fd393b75b29 RDX: 000000000000001c RSI: 0000000020000200 RDI: 000000000000000d RBP: 00007fd393bf6756 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fd393d04070 R15: 00007ffec068e4f8 Allocated by task 15045: 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:4122 [inline] __kmalloc_noprof+0x1f9/0x400 mm/slub.c:4135 kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] fib6_info_alloc+0x2e/0xf0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x445/0x12b0 net/ipv6/route.c:3761 ip6_route_add+0x28/0x160 net/ipv6/route.c:3853 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:8909 do_setlink+0xccd/0x41f0 net/core/rtnetlink.c:2900 __rtnl_newlink net/core/rtnetlink.c:3696 [inline] rtnl_newlink+0x180d/0x20a0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x89b/0x1180 net/core/rtnetlink.c:6641 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x7f0/0x990 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2192 __do_sys_sendto net/socket.c:2204 [inline] __se_sys_sendto net/socket.c:2200 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2200 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 Freed by task 1049: 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+0xe0/0x150 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:2196 [inline] slab_free mm/slub.c:4437 [inline] kfree+0x149/0x360 mm/slub.c:4558 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2809 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 do_softirq+0x11b/0x1e0 kernel/softirq.c:455 __local_bh_enable_ip+0x1bb/0x200 kernel/softirq.c:382 pneigh_ifdown_and_unlock net/core/neighbour.c:867 [inline] __neigh_ifdown+0x1c6/0x400 net/core/neighbour.c:447 neigh_ifdown+0x1f/0x30 net/core/neighbour.c:464 ndisc_netdev_event+0xcc/0x4d0 net/ipv6/ndisc.c:1920 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline] call_netdevice_notifiers net/core/dev.c:2046 [inline] dev_close_many+0x33c/0x4c0 net/core/dev.c:1587 unregister_netdevice_many_notify+0x544/0x16b0 net/core/dev.c:11295 unregister_netdevice_many net/core/dev.c:11378 [inline] default_device_exit_batch+0xa0f/0xa90 net/core/dev.c:11861 ops_exit_list net/core/net_namespace.c:178 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:640 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 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:3072 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3176 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:2014 [inline] fib6_del+0x114b/0x1600 net/ipv6/ip6_fib.c:2047 fib6_clean_node+0x2f7/0x5e0 net/ipv6/ip6_fib.c:2209 fib6_walk_continue+0x658/0x8f0 net/ipv6/ip6_fib.c:2131 fib6_walk+0x168/0x2b0 net/ipv6/ip6_fib.c:2179 fib6_clean_tree net/ipv6/ip6_fib.c:2259 [inline] __fib6_clean_all+0x31f/0x4b0 net/ipv6/ip6_fib.c:2275 rt6_sync_down_dev net/ipv6/route.c:4908 [inline] rt6_disable_ip+0x164/0x7e0 net/ipv6/route.c:4913 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:2032 [inline] call_netdevice_notifiers net/core/dev.c:2046 [inline] dev_close_many+0x33c/0x4c0 net/core/dev.c:1587 unregister_netdevice_many_notify+0x544/0x16b0 net/core/dev.c:11295 unregister_netdevice_many net/core/dev.c:11378 [inline] default_device_exit_batch+0xa0f/0xa90 net/core/dev.c:11861 ops_exit_list net/core/net_namespace.c:178 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:640 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 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 ffff88802e51c400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 48 bytes inside of freed 512-byte region [ffff88802e51c400, ffff88802e51c600) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2e51c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff888015041c80 ffffea00009a0700 dead000000000002 raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff888015041c80 ffffea00009a0700 dead000000000002 head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000002 ffffea0000b94701 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5094, tgid 5094 (syz-executor), ts 81552914740, free_ts 81273802262 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2e43/0x2f00 mm/page_alloc.c:3420 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2265 allocate_slab+0x5a/0x2f0 mm/slub.c:2428 new_slab mm/slub.c:2481 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3667 __slab_alloc+0x58/0xa0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] __do_kmalloc_node mm/slub.c:4121 [inline] __kmalloc_noprof+0x257/0x400 mm/slub.c:4135 kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] fib6_info_alloc+0x2e/0xf0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x445/0x12b0 net/ipv6/route.c:3761 ip6_route_add+0x28/0x160 net/ipv6/route.c:3853 addrconf_add_mroute net/ipv6/addrconf.c:2549 [inline] addrconf_add_dev+0x35b/0x540 net/ipv6/addrconf.c:2567 inet6_addr_add+0x258/0xb00 net/ipv6/addrconf.c:3023 inet6_rtm_newaddr+0x8a3/0xc80 net/ipv6/addrconf.c:5047 rtnetlink_rcv_msg+0x89b/0x1180 net/core/rtnetlink.c:6641 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550 page last free pid 5180 tgid 5180 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2583 discard_slab mm/slub.c:2527 [inline] __put_partials+0xeb/0x130 mm/slub.c:2995 put_cpu_partial+0x17c/0x250 mm/slub.c:3070 __slab_free+0x2ea/0x3d0 mm/slub.c:4307 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 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:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4044 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:664 alloc_skb include/linux/skbuff.h:1320 [inline] nlmsg_new include/net/netlink.h:1015 [inline] rtmsg_ifinfo_build_skb+0x84/0x260 net/core/rtnetlink.c:4064 rtmsg_ifinfo_event net/core/rtnetlink.c:4107 [inline] rtmsg_ifinfo+0x91/0x1b0 net/core/rtnetlink.c:4116 netdev_state_change+0x139/0x1a0 net/core/dev.c:1378 linkwatch_do_dev+0x112/0x170 net/core/link_watch.c:177 __linkwatch_run_queue+0x44f/0x6c0 net/core/link_watch.c:234 linkwatch_event+0x4c/0x60 net/core/link_watch.c:277 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 Memory state around the buggy address: ffff88802e51c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802e51c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802e51c400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802e51c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802e51c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================