================================================================== BUG: KASAN: slab-use-after-free in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff888036fa6248 by task syz-executor.0/4904 CPU: 1 PID: 4904 Comm: syz-executor.0 Not tainted 6.5.0-syzkaller-12673-g73be7fb14e83 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/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+0x11c1/0x2720 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/0x3900 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:4889 [inline] netdev_start_xmit include/linux/netdevice.h:4903 [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+0x24f9/0x3d80 net/core/dev.c:4306 dev_queue_xmit include/linux/netdevice.h:3082 [inline] neigh_connected_output+0x42c/0x5d0 net/core/neighbour.c:1581 neigh_output include/net/neighbour.h:542 [inline] ip6_finish_output2+0x610/0x1b20 net/ipv6/ip6_output.c:135 ip6_fragment+0xbf4/0x2a40 net/ipv6/ip6_output.c:1007 __ip6_finish_output net/ipv6/ip6_output.c:194 [inline] ip6_finish_output+0x803/0x1250 net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:293 [inline] ip6_output+0x23a/0x880 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 udp_v6_send_skb+0x9b2/0x1900 net/ipv6/udp.c:1282 udpv6_sendmsg+0x24d1/0x2fa0 net/ipv6/udp.c:1576 inet6_sendmsg+0x9d/0xe0 net/ipv6/af_inet6.c:655 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:753 ____sys_sendmsg+0x2ac/0x940 net/socket.c:2541 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2595 __sys_sendmmsg+0x1a1/0x450 net/socket.c:2681 __do_sys_sendmmsg net/socket.c:2710 [inline] __se_sys_sendmmsg net/socket.c:2707 [inline] __x64_sys_sendmmsg+0x9c/0x100 net/socket.c:2707 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:0x7fcc9467cae9 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:00007fcc9538b0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fcc9479bf80 RCX: 00007fcc9467cae9 RDX: 0000000000000001 RSI: 00000000200026c0 RDI: 0000000000000003 RBP: 00007fcc946c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fcc9479bf80 R15: 00007ffef75f1998 Allocated by task 18913: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:1023 [inline] __kmalloc_node_track_caller+0x61/0x100 mm/slab_common.c:1043 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:581 pskb_expand_head+0x236/0x1170 net/core/skbuff.c:2093 __skb_cow include/linux/skbuff.h:3586 [inline] skb_cow_head include/linux/skbuff.h:3620 [inline] batadv_skb_head_push+0xf5/0x290 net/batman-adv/soft-interface.c:72 batadv_send_skb_packet+0x116/0x6b0 net/batman-adv/send.c:86 batadv_iv_ogm_send_to_if net/batman-adv/bat_iv_ogm.c:392 [inline] batadv_iv_ogm_emit net/batman-adv/bat_iv_ogm.c:420 [inline] batadv_iv_send_outstanding_bat_ogm_packet+0x708/0x8c0 net/batman-adv/bat_iv_ogm.c:1700 process_one_work+0x887/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784 kthread+0x33a/0x430 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 Freed by task 18913: 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:162 [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+0xb8/0x2f0 mm/slub.c:3822 skb_kfree_head net/core/skbuff.c:945 [inline] skb_free_head+0x110/0x1b0 net/core/skbuff.c:957 skb_release_data+0x5ba/0x870 net/core/skbuff.c:987 skb_release_all net/core/skbuff.c:1053 [inline] __kfree_skb net/core/skbuff.c:1067 [inline] kfree_skb_reason+0x101/0x210 net/core/skbuff.c:1103 __netif_receive_skb_core.constprop.0+0x594/0x3f20 net/core/dev.c:5497 __netif_receive_skb_one_core+0xaf/0x180 net/core/dev.c:5521 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:5637 process_backlog+0x101/0x6c0 net/core/dev.c:5965 __napi_poll.constprop.0+0xb4/0x530 net/core/dev.c:6527 napi_poll net/core/dev.c:6594 [inline] net_rx_action+0x956/0xe90 net/core/dev.c:6727 __do_softirq+0x218/0x965 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 rhashtable_rehash_table lib/rhashtable.c:348 [inline] rht_deferred_worker+0x10fd/0x2010 lib/rhashtable.c:432 process_one_work+0x887/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8bb/0x1290 kernel/workqueue.c:2784 kthread+0x33a/0x430 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 Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 qdisc_put+0xd1/0xf0 net/sched/sch_generic.c:1090 shutdown_scheduler_queue+0xa5/0x160 net/sched/sch_generic.c:1143 netdev_for_each_tx_queue include/linux/netdevice.h:2508 [inline] dev_shutdown+0xb6/0x430 net/sched/sch_generic.c:1475 unregister_netdevice_many_notify+0x5bd/0x1a20 net/core/dev.c:10928 unregister_netdevice_many net/core/dev.c:10994 [inline] unregister_netdevice_queue+0x2e5/0x3c0 net/core/dev.c:10874 unregister_netdevice include/linux/netdevice.h:3106 [inline] __tun_detach+0x116f/0x1470 drivers/net/tun.c:684 tun_detach drivers/net/tun.c:700 [inline] tun_chr_close+0xc8/0x240 drivers/net/tun.c:3496 __fput+0x3f7/0xa70 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa99/0x2a20 kernel/exit.c:874 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23d1/0x27b0 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888036fa6000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 584 bytes inside of freed 1024-byte region [ffff888036fa6000, ffff888036fa6400) The buggy address belongs to the physical page: page:ffffea0000dbe800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36fa0 head:ffffea0000dbe800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c41dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 21386, tgid 21384 (syz-executor.2), ts 1398888898125, free_ts 1398858365382 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+0x8be/0x1570 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+0x137/0x350 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc_node_track_caller+0x50/0x100 mm/slab_common.c:1043 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:581 __alloc_skb+0x12b/0x330 net/core/skbuff.c:650 __pskb_copy_fclone+0xee/0xde0 net/core/skbuff.c:2016 __pskb_copy include/linux/skbuff.h:1350 [inline] tipc_sk_mcast_rcv+0x52e/0xf70 net/tipc/socket.c:1250 tipc_mcast_xmit+0x65e/0xdb0 net/tipc/bcast.c:424 tipc_sendmcast+0x87a/0xb50 net/tipc/socket.c:888 __tipc_sendmsg+0x121c/0x17e0 net/tipc/socket.c:1470 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 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x185/0x3f0 mm/slub.c:3523 __alloc_skb+0x287/0x330 net/core/skbuff.c:640 alloc_skb_fclone include/linux/skbuff.h:1336 [inline] tipc_buf_acquire+0x26/0xe0 net/tipc/msg.c:72 tipc_msg_build+0x117/0x1100 net/tipc/msg.c:386 tipc_sendmcast+0x797/0xb50 net/tipc/socket.c:882 __tipc_sendmsg+0x121c/0x17e0 net/tipc/socket.c:1470 tipc_sendmsg+0x4f/0x70 net/tipc/socket.c:1404 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:753 ____sys_sendmsg+0x2ac/0x940 net/socket.c:2541 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2595 __sys_sendmmsg+0x1a1/0x450 net/socket.c:2681 Memory state around the buggy address: ffff888036fa6100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888036fa6180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888036fa6200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888036fa6280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888036fa6300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================