================================================================== BUG: KASAN: slab-use-after-free in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff88802e9f7e56 by task syz-executor.4/12283 CPU: 0 PID: 12283 Comm: syz-executor.4 Not tainted 6.6.0-rc2-syzkaller-00818-g93e7eca853ca #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 __xfrm_decode_session+0x54/0xb0 net/xfrm/xfrm_policy.c:3566 xfrm_decode_session_reverse include/net/xfrm.h:1223 [inline] icmpv6_route_lookup+0x397/0x550 net/ipv6/icmp.c:388 icmp6_send+0x123c/0x2740 net/ipv6/icmp.c:595 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x31/0x5a0 net/ipv6/route.c:2787 dst_link_failure include/net/dst.h:437 [inline] ip6_tnl_xmit+0x4f9/0x3920 net/ipv6/ip6_tunnel.c:1268 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1384 [inline] ip6_tnl_start_xmit+0x6ef/0x1750 net/ipv6/ip6_tunnel.c:1432 __netdev_start_xmit include/linux/netdevice.h:4911 [inline] netdev_start_xmit include/linux/netdevice.h:4925 [inline] xmit_one net/core/dev.c:3544 [inline] dev_hard_start_xmit+0x13d/0x6c0 net/core/dev.c:3560 sch_direct_xmit+0x1ac/0xc20 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x540/0x19d0 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3834 [inline] __dev_queue_xmit+0x24db/0x3d60 net/core/dev.c:4306 dev_queue_xmit include/linux/netdevice.h:3092 [inline] neigh_connected_output+0x42c/0x5d0 net/core/neighbour.c:1581 neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0x581/0x1700 net/ipv6/ip6_output.c:135 __ip6_finish_output net/ipv6/ip6_output.c:196 [inline] ip6_finish_output+0x485/0x1250 net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:293 [inline] ip6_output+0x1e2/0x530 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] ip6_local_out+0xaf/0x190 net/ipv6/output_core.c:155 ip6_send_skb+0xb7/0x330 net/ipv6/ip6_output.c:2017 ip6_push_pending_frames+0xe0/0x100 net/ipv6/ip6_output.c:2037 l2tp_ip6_push_pending_frames net/l2tp/l2tp_ip6.c:479 [inline] l2tp_ip6_sendmsg+0x1775/0x1ca0 net/l2tp/l2tp_ip6.c:638 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:840 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:753 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2541 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2595 __sys_sendmsg+0x117/0x1e0 net/socket.c:2624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fba69a7cae9 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:00007fba6a8670c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fba69b9bf80 RCX: 00007fba69a7cae9 RDX: 0000000000000000 RSI: 00000000200006c0 RDI: 0000000000000003 RBP: 00007fba69ac847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fba69b9bf80 R15: 00007ffea1d71298 Allocated by task 11606: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x180/0x3f0 mm/slub.c:3523 kmalloc_reserve+0x166/0x260 net/core/skbuff.c:559 __alloc_skb+0x12b/0x330 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1286 [inline] nlmsg_new include/net/netlink.h:999 [inline] inet6_netconf_notify_devconf+0x87/0x180 net/ipv6/addrconf.c:584 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7184 [inline] addrconf_sysctl_unregister+0x131/0x1c0 net/ipv6/addrconf.c:7208 addrconf_ifdown.isra.0+0x162f/0x1c50 net/ipv6/addrconf.c:3948 addrconf_notify+0x22d/0x1920 net/ipv6/addrconf.c:3718 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many_notify+0x85f/0x1a20 net/core/dev.c:10960 rtnl_delete_link net/core/rtnetlink.c:3263 [inline] rtnl_dellink+0x3ba/0xad0 net/core/rtnetlink.c:3315 rtnetlink_rcv_msg+0x3c4/0xdf0 net/core/rtnetlink.c:6480 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x536/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:753 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2541 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2595 __sys_sendmsg+0x117/0x1e0 net/socket.c:2624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 11606: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] kmem_cache_free+0xf0/0x480 mm/slub.c:3831 skb_kfree_head net/core/skbuff.c:947 [inline] skb_kfree_head net/core/skbuff.c:944 [inline] skb_free_head+0x17f/0x1b0 net/core/skbuff.c:961 skb_release_data+0x5ba/0x870 net/core/skbuff.c:991 skb_release_all net/core/skbuff.c:1057 [inline] __kfree_skb net/core/skbuff.c:1071 [inline] consume_skb net/core/skbuff.c:1287 [inline] consume_skb+0xd2/0x170 net/core/skbuff.c:1281 netlink_broadcast_filtered+0x3d4/0xf00 net/netlink/af_netlink.c:1554 netlink_broadcast net/netlink/af_netlink.c:1576 [inline] nlmsg_multicast include/net/netlink.h:1079 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2588 inet6_netconf_notify_devconf+0xe2/0x180 net/ipv6/addrconf.c:596 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7184 [inline] addrconf_sysctl_unregister+0x131/0x1c0 net/ipv6/addrconf.c:7208 addrconf_ifdown.isra.0+0x162f/0x1c50 net/ipv6/addrconf.c:3948 addrconf_notify+0x22d/0x1920 net/ipv6/addrconf.c:3718 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many_notify+0x85f/0x1a20 net/core/dev.c:10960 rtnl_delete_link net/core/rtnetlink.c:3263 [inline] rtnl_dellink+0x3ba/0xad0 net/core/rtnetlink.c:3315 rtnetlink_rcv_msg+0x3c4/0xdf0 net/core/rtnetlink.c:6480 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x536/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:753 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2541 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2595 __sys_sendmsg+0x117/0x1e0 net/socket.c:2624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88802e9f7c00 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 598 bytes inside of freed 640-byte region [ffff88802e9f7c00, ffff88802e9f7e80) The buggy address belongs to the physical page: page:ffffea0000ba7d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802e9f4000 pfn:0x2e9f4 head:ffffea0000ba7d00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff88814007b8c0 0000000000000000 dead000000000001 raw: ffff88802e9f4000 0000000080150003 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 11128, tgid 11127 (syz-executor.4), ts 1407638949000, free_ts 1370258798242 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] kmem_cache_alloc_node+0x132/0x3f0 mm/slub.c:3523 kmalloc_reserve+0x166/0x260 net/core/skbuff.c:559 __alloc_skb+0x12b/0x330 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1286 [inline] nlmsg_new include/net/netlink.h:999 [inline] mpls_netconf_notify_devconf+0x4a/0x110 net/mpls/af_mpls.c:1189 mpls_dev_sysctl_register+0x228/0x330 net/mpls/af_mpls.c:1427 mpls_add_dev net/mpls/af_mpls.c:1478 [inline] mpls_dev_notify+0x48f/0xa00 net/mpls/af_mpls.c:1618 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] register_netdevice+0xf84/0x1490 net/core/dev.c:10191 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 vfree+0x181/0x7a0 mm/vmalloc.c:2842 kvfree+0x33/0x50 mm/util.c:651 htab_map_free+0x360/0xb20 kernel/bpf/hashtab.c:1545 bpf_map_free_deferred+0x18b/0x3b0 kernel/bpf/syscall.c:702 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff88802e9f7d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802e9f7d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802e9f7e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802e9f7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802e9f7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================