================================================================== BUG: KASAN: use-after-free in decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 Read of size 1 at addr ffff8880585c08dc by task kworker/0:10/11864 CPU: 0 PID: 11864 Comm: kworker/0:10 Not tainted 5.11.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: ipv6_addrconf addrconf_dad_work Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3485 xfrm_decode_session include/net/xfrm.h:1137 [inline] vti_tunnel_xmit+0x264/0x1980 net/ipv4/ip_vti.c:292 __netdev_start_xmit include/linux/netdevice.h:4776 [inline] netdev_start_xmit include/linux/netdevice.h:4790 [inline] xmit_one net/core/dev.c:3574 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3590 sch_direct_xmit+0x2e1/0xbd0 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4ba/0x15f0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3813 [inline] __dev_queue_xmit+0x1a30/0x2dd0 net/core/dev.c:4119 neigh_connected_output+0x380/0x4c0 net/core/neighbour.c:1520 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x6b8/0x16c0 net/ipv6/ip6_output.c:117 __ip6_finish_output net/ipv6/ip6_output.c:182 [inline] __ip6_finish_output+0x4c1/0xe10 net/ipv6/ip6_output.c:161 ip6_finish_output+0x35/0x200 net/ipv6/ip6_output.c:192 NF_HOOK_COND include/linux/netfilter.h:290 [inline] ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:215 dst_output include/net/dst.h:441 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ndisc_send_skb+0xa90/0x1750 net/ipv6/ndisc.c:508 ndisc_send_rs+0x12e/0x700 net/ipv6/ndisc.c:702 addrconf_dad_completed+0x2fe/0xc60 net/ipv6/addrconf.c:4192 addrconf_dad_begin net/ipv6/addrconf.c:3959 [inline] addrconf_dad_work+0x851/0x1280 net/ipv6/addrconf.c:4061 process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x3b1/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Allocated by task 4894: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:557 [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 security_inode_getattr+0xcf/0x140 security/security.c:1280 vfs_getattr fs/stat.c:121 [inline] vfs_fstat+0x43/0xb0 fs/stat.c:146 __do_sys_newfstat+0x81/0x100 fs/stat.c:386 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 4894: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:188 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3142 [inline] kfree+0xdb/0x3b0 mm/slub.c:4124 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 security_inode_getattr+0xcf/0x140 security/security.c:1280 vfs_getattr fs/stat.c:121 [inline] vfs_fstat+0x43/0xb0 fs/stat.c:146 __do_sys_newfstat+0x81/0x100 fs/stat.c:386 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8880585c0000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2268 bytes inside of 4096-byte region [ffff8880585c0000, ffff8880585c1000) The buggy address belongs to the page: page:000000005c13e742 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x585c0 head:000000005c13e742 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 0000000000000000 0000000200000001 ffff888010042140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880585c0780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880585c0800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880585c0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880585c0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880585c0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================