================================================================== BUG: KASAN: use-after-free in rose_transmit_link+0x5b6/0x730 net/rose/rose_link.c:266 Read of size 1 at addr ffff888024e97c32 by task syz.5.4357/20583 CPU: 1 PID: 20583 Comm: syz.5.4357 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x220 mm/kasan/report.c:427 kasan_report+0x10b/0x140 mm/kasan/report.c:531 rose_transmit_link+0x5b6/0x730 net/rose/rose_link.c:266 rose_write_internal+0x1096/0x1eb0 net/rose/rose_subr.c:198 rose_release+0x22a/0x4f0 net/rose/af_rose.c:671 __sock_release net/socket.c:654 [inline] sock_close+0xd5/0x240 net/socket.c:1400 __fput+0x22c/0x920 fs/file_table.c:320 task_work_run+0x1ca/0x250 kernel/task_work.c:203 get_signal+0x11a6/0x1350 kernel/signal.c:2648 arch_do_signal_or_restart+0xb0/0x1230 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f382918e929 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:00007f3829fe9038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffe00 RBX: 00007f38293b6080 RCX: 00007f382918e929 RDX: 0000000000000040 RSI: 00002000000000c0 RDI: 0000000000000008 RBP: 00007f3829210b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f38293b6080 R15: 00007ffc3453f418 Allocated by task 17586: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:563 [inline] rose_add_node+0x227/0xdb0 net/rose/rose_route.c:85 rose_rt_ioctl+0xa4c/0xe90 net/rose/rose_route.c:747 rose_ioctl+0x27a/0x790 net/rose/af_rose.c:1380 sock_do_ioctl+0xd3/0x2f0 net/socket.c:1204 sock_ioctl+0x4ed/0x6e0 net/socket.c:1321 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 20581: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0xb6/0x1f0 mm/slub.c:3674 rose_rt_device_down+0x3e5/0x430 net/rose/rose_route.c:522 rose_device_event+0x600/0x690 net/rose/af_rose.c:248 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline] call_netdevice_notifiers net/core/dev.c:2053 [inline] __dev_notify_flags+0x178/0x2d0 net/core/dev.c:-1 dev_change_flags+0xe3/0x1a0 net/core/dev.c:8702 dev_ifsioc+0x159/0xe90 net/core/dev_ioctl.c:327 dev_ioctl+0x578/0xea0 net/core/dev_ioctl.c:588 sock_do_ioctl+0x222/0x2f0 net/socket.c:1218 sock_ioctl+0x4ed/0x6e0 net/socket.c:1321 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486 kvfree_call_rcu+0x108/0x870 kernel/rcu/tree.c:3401 __ipv6_dev_mc_dec+0x2c8/0x330 net/ipv6/mcast.c:982 addrconf_leave_solict net/ipv6/addrconf.c:2210 [inline] __ipv6_ifa_notify+0x710/0xdb0 net/ipv6/addrconf.c:6236 addrconf_ifdown+0xe9a/0x1a10 net/ipv6/addrconf.c:3928 addrconf_notify+0x405/0xf40 net/ipv6/addrconf.c:-1 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline] call_netdevice_notifiers net/core/dev.c:2053 [inline] dev_close_many+0x28d/0x400 net/core/dev.c:1601 unregister_netdevice_many+0x471/0x1840 net/core/dev.c:10952 unregister_netdevice_queue+0x31c/0x360 net/core/dev.c:10909 unregister_netdevice include/linux/netdevice.h:3075 [inline] __tun_detach+0xd4a/0x1500 drivers/net/tun.c:685 tun_detach drivers/net/tun.c:701 [inline] tun_chr_close+0x109/0x1b0 drivers/net/tun.c:3492 __fput+0x22c/0x920 fs/file_table.c:320 task_work_run+0x1ca/0x250 kernel/task_work.c:203 get_signal+0x11a6/0x1350 kernel/signal.c:2648 arch_do_signal_or_restart+0xb0/0x1230 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Second to last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486 call_rcu+0x14b/0x970 kernel/rcu/tree.c:2845 fib6_info_release include/net/ip6_fib.h:340 [inline] ip6_route_info_create+0x9c5/0x1210 net/ipv6/route.c:3876 ip6_route_add+0x24/0x130 net/ipv6/route.c:3890 addrconf_prefix_route+0x20d/0x2b0 net/ipv6/addrconf.c:2443 inet6_addr_add+0x4fe/0x9b0 net/ipv6/addrconf.c:3017 inet6_rtm_newaddr+0x617/0x870 net/ipv6/addrconf.c:4979 rtnetlink_rcv_msg+0x79b/0xed0 net/core/rtnetlink.c:6153 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2493 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x74c/0x8c0 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1859 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] __sys_sendto+0x44f/0x5c0 net/socket.c:2153 __do_sys_sendto net/socket.c:2165 [inline] __se_sys_sendto net/socket.c:2161 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2161 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff888024e97c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 50 bytes inside of 512-byte region [ffff888024e97c00, ffff888024e97e00) The buggy address belongs to the physical page: page:ffffea000093a500 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888024e97800 pfn:0x24e94 head:ffffea000093a500 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001616208 ffffea000090bc08 ffff888017441c80 raw: ffff888024e97800 000000000010000e 00000001ffffffff 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 946, tgid 946 (kworker/u4:4), ts 9257752567, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614 alloc_slab_page+0x5d/0x160 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x87/0x2c0 mm/slub.c:1992 ___slab_alloc+0xbc6/0x1220 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:699 [inline] alloc_bprm+0x56/0x730 fs/exec.c:1537 kernel_execve+0x94/0x9c0 fs/exec.c:2004 call_usermodehelper_exec_async+0x207/0x350 kernel/umh.c:113 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page_owner free stack trace missing Memory state around the buggy address: ffff888024e97b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888024e97b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888024e97c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888024e97c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024e97d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================