================================================================== BUG: KASAN: use-after-free in decode_session6+0xe6d/0x1530 net/xfrm/xfrm_policy.c:3369 Read of size 1 at addr ffff888027c0e29f by task kworker/0:13/9597 CPU: 0 PID: 9597 Comm: kworker/0:13 Not tainted 5.15.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: mld mld_ifc_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 decode_session6+0xe6d/0x1530 net/xfrm/xfrm_policy.c:3369 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3456 xfrm_decode_session include/net/xfrm.h:1149 [inline] vti_tunnel_xmit+0x26d/0x1b80 net/ipv4/ip_vti.c:294 __netdev_start_xmit include/linux/netdevice.h:4987 [inline] netdev_start_xmit include/linux/netdevice.h:5001 [inline] xmit_one net/core/dev.c:3590 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3606 sch_direct_xmit+0x19f/0xbc0 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x4bc/0x1700 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3875 [inline] __dev_queue_xmit+0x2091/0x3630 net/core/dev.c:4194 neigh_connected_output+0x3b6/0x510 net/core/neighbour.c:1552 neigh_output include/net/neighbour.h:527 [inline] ip6_finish_output2+0x571/0x14e0 net/ipv6/ip6_output.c:126 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline] __ip6_finish_output+0x4c1/0x1050 net/ipv6/ip6_output.c:170 ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:450 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] mld_sendpack+0x9a1/0xe40 net/ipv6/mcast.c:1826 mld_send_cr net/ipv6/mcast.c:2127 [inline] mld_ifc_work+0x71c/0xdc0 net/ipv6/mcast.c:2659 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 6565: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 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 mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:595 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 tomoyo_path_rmdir+0x8e/0xd0 security/tomoyo/tomoyo.c:182 security_path_rmdir+0xd7/0x150 security/security.c:1149 do_rmdir+0x284/0x430 fs/namei.c:4026 __do_sys_rmdir fs/namei.c:4049 [inline] __se_sys_rmdir fs/namei.c:4047 [inline] __x64_sys_rmdir+0xc6/0x110 fs/namei.c:4047 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 6565: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kfree+0xf6/0x560 mm/slub.c:4561 tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 tomoyo_path_rmdir+0x8e/0xd0 security/tomoyo/tomoyo.c:182 security_path_rmdir+0xd7/0x150 security/security.c:1149 do_rmdir+0x284/0x430 fs/namei.c:4026 __do_sys_rmdir fs/namei.c:4049 [inline] __se_sys_rmdir fs/namei.c:4047 [inline] __x64_sys_rmdir+0xc6/0x110 fs/namei.c:4047 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888027c0e000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 671 bytes inside of 4096-byte region [ffff888027c0e000, ffff888027c0f000) The buggy address belongs to the page: page:ffffea00009f0200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27c08 head:ffffea00009f0200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001a0c800 dead000000000002 ffff888010c42140 raw: 0000000000000000 0000000000040004 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6551, ts 132928963848, free_ts 0 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x32d/0x4a0 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc_trace+0x289/0x2c0 mm/slub.c:3259 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] snmp6_alloc_dev net/ipv6/addrconf.c:360 [inline] ipv6_add_dev+0x555/0x1170 net/ipv6/addrconf.c:410 addrconf_notify+0x60e/0x1bb0 net/ipv6/addrconf.c:3510 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2002 call_netdevice_notifiers_extack net/core/dev.c:2014 [inline] call_netdevice_notifiers net/core/dev.c:2028 [inline] register_netdevice+0x1073/0x1500 net/core/dev.c:10364 veth_newlink+0x3fc/0xb00 drivers/net/veth.c:1695 __rtnl_newlink+0x106d/0x1750 net/core/rtnetlink.c:3458 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5571 page_owner free stack trace missing Memory state around the buggy address: ffff888027c0e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027c0e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888027c0e280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888027c0e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027c0e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================