================================================================== BUG: KASAN: use-after-free in xfrm_lookup_with_ifid+0x2243/0x22f0 net/xfrm/xfrm_policy.c:3082 Read of size 4 at addr ffff88805ccb365c by task syz-executor.4/4591 CPU: 0 PID: 4591 Comm: syz-executor.4 Not tainted 5.6.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x32 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:641 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134 xfrm_lookup_with_ifid+0x2243/0x22f0 net/xfrm/xfrm_policy.c:3082 xfrmi_xmit2 net/xfrm/xfrm_interface.c:272 [inline] xfrmi_xmit+0x43f/0x15e0 net/xfrm/xfrm_interface.c:387 __netdev_start_xmit include/linux/netdevice.h:4524 [inline] netdev_start_xmit include/linux/netdevice.h:4538 [inline] xmit_one net/core/dev.c:3470 [inline] dev_hard_start_xmit+0x1a3/0x9b0 net/core/dev.c:3486 __dev_queue_xmit+0x2b05/0x35c0 net/core/dev.c:4063 dev_queue_xmit+0x18/0x20 net/core/dev.c:4096 neigh_direct_output+0x16/0x20 net/core/neighbour.c:1527 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x109a/0x25c0 net/ipv6/ip6_output.c:116 __ip6_finish_output+0x444/0xaa0 net/ipv6/ip6_output.c:142 ip6_finish_output+0x38/0x1f0 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x25e/0x880 net/ipv6/ip6_output.c:175 dst_output include/net/dst.h:436 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xf1f/0x1490 net/ipv6/ndisc.c:505 ndisc_send_rs+0x134/0x720 net/ipv6/ndisc.c:699 addrconf_rs_timer+0x30f/0x6e0 net/ipv6/addrconf.c:3879 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1082 do_softirq.part.0+0x11a/0x170 kernel/softirq.c:337 do_softirq kernel/softirq.c:329 [inline] __local_bh_enable_ip+0x211/0x270 kernel/softirq.c:189 local_bh_enable include/linux/bottom_half.h:32 [inline] get_next_corpse net/netfilter/nf_conntrack_core.c:2012 [inline] nf_ct_iterate_cleanup+0x212/0x4e0 net/netfilter/nf_conntrack_core.c:2035 nf_ct_iterate_cleanup_net net/netfilter/nf_conntrack_core.c:2120 [inline] nf_ct_iterate_cleanup_net+0x133/0x190 net/netfilter/nf_conntrack_core.c:2105 masq_device_event+0xb5/0xe0 net/netfilter/nf_nat_masquerade.c:88 notifier_call_chain+0xc2/0x230 kernel/notifier.c:83 __raw_notifier_call_chain kernel/notifier.c:361 [inline] raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:368 call_netdevice_notifiers_info net/core/dev.c:1943 [inline] call_netdevice_notifiers_info+0xba/0x130 net/core/dev.c:1928 call_netdevice_notifiers_extack net/core/dev.c:1955 [inline] call_netdevice_notifiers net/core/dev.c:1969 [inline] dev_close_many+0x32a/0x6c0 net/core/dev.c:1544 rollback_registered_many+0x42e/0x1030 net/core/dev.c:8797 rollback_registered+0x109/0x1d0 net/core/dev.c:8865 unregister_netdevice_queue net/core/dev.c:9957 [inline] unregister_netdevice_queue+0x1ee/0x2c0 net/core/dev.c:9950 unregister_netdevice include/linux/netdevice.h:2713 [inline] __tun_detach+0xe6d/0x1150 drivers/net/tun.c:723 tun_detach drivers/net/tun.c:740 [inline] tun_chr_close+0xe0/0x180 drivers/net/tun.c:3459 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x416261 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007fff0815dc30 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000416261 RDX: 0000001b2d120000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 0000000000000001 R08: 00000000ad0cfb9f R09: 00000000ad0cfba3 R10: 00007fff0815dd10 R11: 0000000000000293 R12: 000000000076bf20 R13: 00000000001438f4 R14: 0000000000778d30 R15: 000000000076bf2c The buggy address belongs to the page: page:ffffea0001732cc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0xfffe0000000000() raw: 00fffe0000000000 0000000000000000 ffffffff01730101 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805ccb3500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805ccb3580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805ccb3600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805ccb3680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805ccb3700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================