================================================================== BUG: KASAN: use-after-free in decode_session6 net/xfrm/xfrm_policy.c:3413 [inline] BUG: KASAN: use-after-free in __xfrm_decode_session+0x140c/0x1ad4 net/xfrm/xfrm_policy.c:3520 Read of size 1 at addr ffff0000e87e30c8 by task syz.2.457/6079 CPU: 0 PID: 6079 Comm: syz.2.457 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 print_address_description+0x78/0x30c mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xec/0x15c mm/kasan/report.c:451 __asan_report_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306 decode_session6 net/xfrm/xfrm_policy.c:3413 [inline] __xfrm_decode_session+0x140c/0x1ad4 net/xfrm/xfrm_policy.c:3520 xfrm_decode_session_reverse include/net/xfrm.h:1177 [inline] icmpv6_route_lookup+0x310/0x470 net/ipv6/icmp.c:394 icmp6_send+0xbd0/0x144c net/ipv6/icmp.c:601 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x44/0x4a8 net/ipv6/route.c:2788 dst_link_failure include/net/dst.h:422 [inline] ip6_tnl_xmit+0x6d4/0x20b4 net/ipv6/ip6_tunnel.c:1275 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1391 [inline] ip6_tnl_start_xmit+0xba0/0x10cc net/ipv6/ip6_tunnel.c:1440 __netdev_start_xmit include/linux/netdevice.h:5027 [inline] netdev_start_xmit include/linux/netdevice.h:5041 [inline] xmit_one net/core/dev.c:3649 [inline] dev_hard_start_xmit+0x2a8/0x87c net/core/dev.c:3665 sch_direct_xmit+0x2a4/0x3bc net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x85c/0x1170 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3942 [inline] __dev_queue_xmit+0xfe0/0x2800 net/core/dev.c:4253 dev_queue_xmit+0x24/0x34 net/core/dev.c:4321 neigh_connected_output+0x32c/0x370 net/core/neighbour.c:1533 neigh_output include/net/neighbour.h:509 [inline] ip6_finish_output2+0x12d0/0x1a14 net/ipv6/ip6_output.c:130 ip6_fragment+0x18a0/0x22e4 net/ipv6/ip6_output.c:937 __ip6_finish_output net/ipv6/ip6_output.c:199 [inline] ip6_finish_output+0x550/0x6dc net/ipv6/ip6_output.c:211 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x274/0x500 net/ipv6/ip6_output.c:234 dst_output include/net/dst.h:452 [inline] ip6_local_out+0x120/0x15c net/ipv6/output_core.c:161 ip6_send_skb+0x1a8/0x4f4 net/ipv6/ip6_output.c:1951 ip6_push_pending_frames+0xd0/0x118 net/ipv6/ip6_output.c:1972 rawv6_push_pending_frames+0x508/0x694 net/ipv6/raw.c:617 rawv6_sendmsg+0xe58/0x12e8 net/ipv6/raw.c:961 inet_sendmsg+0x154/0x284 net/ipv4/af_inet.c:834 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] sock_write_iter+0x23c/0x31c net/socket.c:1079 do_iter_readv_writev+0x3a0/0x4f8 fs/read_write.c:-1 do_iter_write+0x1c4/0x670 fs/read_write.c:855 vfs_writev fs/read_write.c:928 [inline] do_writev+0x1e0/0x380 fs/read_write.c:971 __do_sys_writev fs/read_write.c:1044 [inline] __se_sys_writev fs/read_write.c:1041 [inline] __arm64_sys_writev+0x80/0x94 fs/read_write.c:1041 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Allocated by task 3655: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb0/0xf0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc_node_track_caller+0x234/0x3bc mm/slub.c:4963 kmalloc_reserve+0xe4/0x26c net/core/skbuff.c:356 __alloc_skb+0x23c/0x67c net/core/skbuff.c:427 alloc_skb include/linux/skbuff.h:1162 [inline] alloc_uevent_skb+0x78/0x1e0 lib/kobject_uevent.c:290 uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline] kobject_uevent_net_broadcast+0x2c0/0x53c lib/kobject_uevent.c:409 kobject_uevent_env+0x548/0x888 lib/kobject_uevent.c:608 kobject_synth_uevent+0x82c/0xa74 lib/kobject_uevent.c:208 uevent_store+0x34/0x80 drivers/base/core.c:2428 dev_attr_store+0x6c/0x90 drivers/base/core.c:2126 sysfs_kf_write+0x1f8/0x278 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x320/0x478 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x7c8/0xa2c fs/read_write.c:594 ksys_write+0x120/0x210 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:656 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 3655: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1e8 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x170/0x40c mm/slub.c:4559 skb_free_head net/core/skbuff.c:655 [inline] skb_release_data+0x3c0/0x5ac net/core/skbuff.c:677 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb net/core/skbuff.c:756 [inline] consume_skb+0x138/0x33c net/core/skbuff.c:914 skb_free_datagram+0x30/0xe4 net/core/datagram.c:325 netlink_recvmsg+0x448/0xac4 net/netlink/af_netlink.c:1997 ____sys_recvmsg+0x254/0x794 net/socket.c:-1 ___sys_recvmsg+0x1ac/0x220 net/socket.c:2697 __sys_recvmsg net/socket.c:2727 [inline] __do_sys_recvmsg net/socket.c:2737 [inline] __se_sys_recvmsg net/socket.c:2734 [inline] __arm64_sys_recvmsg+0x1a4/0x250 net/socket.c:2734 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xcc/0x114 mm/kasan/generic.c:348 kvfree_call_rcu+0xb8/0x66c kernel/rcu/tree.c:3600 drop_sysctl_table+0x274/0x39c fs/proc/proc_sysctl.c:1685 drop_sysctl_table+0x294/0x39c fs/proc/proc_sysctl.c:1688 unregister_sysctl_table+0x94/0x134 fs/proc/proc_sysctl.c:1723 unregister_net_sysctl_table+0x20/0x30 net/sysctl_net.c:175 __devinet_sysctl_unregister net/ipv4/devinet.c:2627 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2655 [inline] inetdev_destroy net/ipv4/devinet.c:326 [inline] inetdev_event+0x578/0x127c net/ipv4/devinet.c:1612 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2049 [inline] call_netdevice_notifiers_extack net/core/dev.c:2061 [inline] call_netdevice_notifiers net/core/dev.c:2075 [inline] unregister_netdevice_many+0xe10/0x17d0 net/core/dev.c:11134 default_device_exit_batch+0x444/0x4a4 net/core/dev.c:11667 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x644/0xa98 net/core/net_namespace.c:635 process_one_work+0x79c/0x1140 kernel/workqueue.c:2310 worker_thread+0x8f4/0x101c kernel/workqueue.c:2457 kthread+0x374/0x454 kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855 The buggy address belongs to the object at ffff0000e87e3000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 200 bytes inside of 512-byte region [ffff0000e87e3000, ffff0000e87e3200) The buggy address belongs to the page: page:0000000085b558d6 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1287e0 head:0000000085b558d6 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 0000000c00000001 ffff0000c0002600 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e87e2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000e87e3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000e87e3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000e87e3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e87e3180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================