================================================================== BUG: KASAN: slab-use-after-free in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff88807c52ca8e by task kworker/0:4/5116 CPU: 0 PID: 5116 Comm: kworker/0:4 Not tainted 6.5.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 Workqueue: mld mld_dad_work 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 include/net/xfrm.h:1216 [inline] vti_tunnel_xmit+0x283/0x1a30 net/ipv4/ip_vti.c:294 __netdev_start_xmit include/linux/netdevice.h:4910 [inline] netdev_start_xmit include/linux/netdevice.h:4924 [inline] xmit_one net/core/dev.c:3537 [inline] dev_hard_start_xmit+0x13d/0x6c0 net/core/dev.c:3553 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:3827 [inline] __dev_queue_xmit+0x26ab/0x3f20 net/core/dev.c:4169 dev_queue_xmit include/linux/netdevice.h:3088 [inline] neigh_connected_output+0x42c/0x5d0 net/core/neighbour.c:1581 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0x5d0/0x1b20 net/ipv6/ip6_output.c:135 __ip6_finish_output net/ipv6/ip6_output.c:196 [inline] ip6_finish_output+0x485/0x11d0 net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip6_output+0x243/0x890 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] NF_HOOK.constprop.0+0xfd/0x540 include/linux/netfilter.h:303 mld_sendpack+0x715/0xd60 net/ipv6/mcast.c:1820 mld_send_initial_cr.part.0+0x1a1/0x260 net/ipv6/mcast.c:2239 mld_send_initial_cr net/ipv6/mcast.c:2227 [inline] mld_dad_work+0x57/0x2e0 net/ipv6/mcast.c:2262 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 8210: 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:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3470 [inline] kmem_cache_alloc_node+0x185/0x3f0 mm/slub.c:3515 kmalloc_reserve+0x167/0x270 net/core/skbuff.c:559 __alloc_skb+0x12b/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1289 [inline] nlmsg_new include/net/netlink.h:1003 [inline] __neigh_notify+0x83/0x160 net/core/neighbour.c:3502 neigh_cleanup_and_release+0x8f/0x280 net/core/neighbour.c:101 neigh_periodic_work+0x672/0xb60 net/core/neighbour.c:994 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Freed by task 8210: 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+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] kmem_cache_free+0xf0/0x490 mm/slub.c:3823 skb_kfree_head net/core/skbuff.c:892 [inline] skb_kfree_head net/core/skbuff.c:889 [inline] skb_free_head+0x17f/0x1b0 net/core/skbuff.c:906 skb_release_data+0x5ba/0x870 net/core/skbuff.c:936 skb_release_all net/core/skbuff.c:1002 [inline] __kfree_skb net/core/skbuff.c:1016 [inline] consume_skb net/core/skbuff.c:1232 [inline] consume_skb+0xd2/0x170 net/core/skbuff.c:1226 netlink_broadcast+0x3ad/0xea0 net/netlink/af_netlink.c:1538 nlmsg_multicast include/net/netlink.h:1083 [inline] nlmsg_notify+0x99/0x210 net/netlink/af_netlink.c:2592 __neigh_notify+0xd9/0x160 net/core/neighbour.c:3513 neigh_cleanup_and_release+0x8f/0x280 net/core/neighbour.c:101 neigh_periodic_work+0x672/0xb60 net/core/neighbour.c:994 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff88807c52c900 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 398 bytes inside of freed 640-byte region [ffff88807c52c900, ffff88807c52cb80) The buggy address belongs to the physical page: page:ffffea0001f14b00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c52c head:ffffea0001f14b00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888019a5c780 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000150015 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 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 8210, tgid 8210 (kworker/1:13), ts 983394919217, free_ts 979689134782 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2292 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] kmem_cache_alloc_node+0x137/0x3f0 mm/slub.c:3515 kmalloc_reserve+0x167/0x270 net/core/skbuff.c:559 __alloc_skb+0x12b/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1289 [inline] nlmsg_new include/net/netlink.h:1003 [inline] __neigh_notify+0x83/0x160 net/core/neighbour.c:3502 neigh_cleanup_and_release+0x8f/0x280 net/core/neighbour.c:101 neigh_periodic_work+0x672/0xb60 net/core/neighbour.c:994 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 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:3470 [inline] __kmem_cache_alloc_node+0x19b/0x350 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0x4c/0x100 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] tomoyo_realpath_from_path+0xb9/0x710 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x243/0x590 security/tomoyo/file.c:723 security_file_ioctl+0x72/0xb0 security/security.c:2608 __do_sys_ioctl fs/ioctl.c:864 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0xbb/0x210 fs/ioctl.c:856 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 Memory state around the buggy address: ffff88807c52c980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807c52ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807c52ca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807c52cb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807c52cb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================