[ 21.598742] default_idle+0xbf/0x460 [ 21.602419] ? __sched_text_end+0x4/0x4 [ 21.606362] ? tick_nohz_idle_enter+0xde/0x160 [ 21.610913] arch_cpu_idle+0xa/0x10 [ 21.614510] default_idle_call+0x36/0x90 [ 21.618537] do_idle+0x24e/0x3b0 [ 21.621901] ? complete+0x62/0x80 [ 21.625327] cpu_startup_entry+0x18/0x20 [ 21.629353] start_secondary+0x2ea/0x3f0 [ 21.633388] secondary_startup_64+0xa5/0xa5 Warning: Permanently added 'ci-upstream-net-kasan-gce-8,10.128.0.18' (ECDSA) to the list of known hosts. executing program [ 27.696250] ================================================================== [ 27.703635] BUG: KASAN: use-after-free in __xfrm_state_lookup+0x695/0x6b0 [ 27.710526] Read of size 4 at addr ffff8801d434e538 by task syzkaller647520/2991 [ 27.718023] [ 27.719620] CPU: 1 PID: 2991 Comm: syzkaller647520 Not tainted 4.14.0-rc5+ #89 [ 27.726941] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 27.736260] Call Trace: [ 27.738809] [ 27.740927] dump_stack+0x194/0x257 [ 27.744524] ? arch_local_irq_restore+0x53/0x53 [ 27.749156] ? show_regs_print_info+0x65/0x65 [ 27.753618] ? __pskb_pull_tail+0x8a5/0x17c0 [ 27.757990] ? __xfrm_state_lookup+0x695/0x6b0 [ 27.762538] print_address_description+0x73/0x250 [ 27.767344] ? __xfrm_state_lookup+0x695/0x6b0 [ 27.771890] kasan_report+0x25b/0x340 [ 27.775656] __asan_report_load4_noabort+0x14/0x20 [ 27.780549] __xfrm_state_lookup+0x695/0x6b0 [ 27.784926] ? xfrm_hash_resize+0x1280/0x1280 [ 27.789386] ? sk_filter_trim_cap+0xdf/0x9b0 [ 27.793759] ? secpath_set+0x19e/0x240 [ 27.797610] ? sk_skb_is_valid_access+0x140/0x140 [ 27.802423] xfrm_state_lookup+0x8a/0x160 [ 27.806537] xfrm_input+0x8e5/0x22f0 [ 27.810221] ? xfrm_parse_spi+0x4d0/0x4d0 [ 27.814336] ? __raw_v6_lookup+0x29f/0x390 [ 27.818540] ? _raw_read_unlock+0x22/0x30 [ 27.822656] xfrm6_rcv_tnl+0x168/0x1d0 [ 27.826510] xfrm6_rcv+0x17/0x20 [ 27.829840] xfrm6_ah_rcv+0x166/0x300 [ 27.833605] ? xfrm6_ipcomp_rcv+0x300/0x300 [ 27.837903] ip6_input_finish+0x36f/0x1700 [ 27.842100] ? ip6_input+0x3b4/0x560 [ 27.845779] ? lock_downgrade+0x990/0x990 [ 27.849898] ? ip6_rcv_finish+0x7a0/0x7a0 [ 27.854018] ? ip6table_filter_hook+0x65/0x80 [ 27.858483] ? nf_hook_slow+0xd3/0x1a0 [ 27.862336] ip6_input+0xe9/0x560 [ 27.865754] ? ip6_input_finish+0x1700/0x1700 [ 27.870216] ? ip6table_mangle_hook+0x113/0x910 [ 27.874852] ? ip6_rcv_finish+0x7a0/0x7a0 [ 27.878967] ? lock_acquire+0x1d5/0x580 [ 27.882916] ? ipv6_rcv+0x16b3/0x1f80 [ 27.886684] ip6_rcv_finish+0x1a9/0x7a0 [ 27.890627] ? ip6_make_skb+0x530/0x530 [ 27.894573] ? nf_hook_slow+0xd3/0x1a0 [ 27.898429] ipv6_rcv+0xf28/0x1f80 [ 27.901940] ? ip6_input+0x560/0x560 [ 27.905626] ? lock_acquire+0x1d5/0x580 [ 27.909565] ? cpuacct_charge+0x2de/0x5b0 [ 27.913679] ? ip6_make_skb+0x530/0x530 [ 27.917620] ? ip6_input+0x560/0x560 [ 27.921300] __netif_receive_skb_core+0x1a3e/0x34b0 [ 27.926287] ? nf_ingress+0x9f0/0x9f0 [ 27.930057] ? cpuusage_read+0x10/0x10 [ 27.933912] ? debug_check_no_locks_freed+0x3c0/0x3c0 [ 27.939069] ? unwind_next_frame.part.6+0x1ae/0xc70 [ 27.944052] ? hrtimer_active+0x2fb/0x410 [ 27.948168] ? debug_check_no_locks_freed+0x3c0/0x3c0 [ 27.953327] ? task_fork_fair+0x7b0/0x7b0 [ 27.957444] ? fastpath_timer_check+0x7d5/0xa70 [ 27.962079] ? task_tick_fair+0x11c4/0x2840 [ 27.966371] ? cleanup_timers_list+0x330/0x330 [ 27.970921] ? apic_timer_interrupt+0x9d/0xb0 [ 27.975382] ? acpi_processor_ffh_cstate_enter+0x1e0/0x250 [ 27.980976] ? active_load_balance_cpu_stop+0x1220/0x1220 [ 27.986477] ? irq_exit+0x1cc/0x200 [ 27.990069] ? smp_apic_timer_interrupt+0x177/0x710 [ 27.995049] ? apic_timer_interrupt+0x9d/0xb0 [ 27.999507] ? native_safe_halt+0x6/0x10 [ 28.003536] ? debug_check_no_locks_freed+0x3c0/0x3c0 [ 28.008698] ? lock_acquire+0x1d5/0x580 [ 28.012637] ? process_backlog+0x45f/0x740 [ 28.016837] ? lock_acquire+0x1d5/0x580 [ 28.020775] ? process_backlog+0x1ab/0x740 [ 28.024978] ? lock_release+0xa40/0xa40 [ 28.028916] ? do_raw_spin_trylock+0x190/0x190 [ 28.033466] __netif_receive_skb+0x2c/0x1b0 [ 28.037753] ? __netif_receive_skb+0x2c/0x1b0 [ 28.042213] process_backlog+0x203/0x740 [ 28.046241] net_rx_action+0x792/0x1910 [ 28.050192] ? napi_complete_done+0x6c0/0x6c0 [ 28.054660] ? rcu_process_callbacks+0x38e/0x17b0 [ 28.059467] ? pick_next_task_fair+0x1620/0x1620 [ 28.064186] ? note_gp_changes+0x650/0x650 [ 28.068386] ? timerqueue_add+0x1e9/0x280 [ 28.072502] ? enqueue_hrtimer+0x162/0x490 [ 28.076702] ? __remove_hrtimer+0x190/0x190 [ 28.080995] ? lock_acquire+0x1d5/0x580 [ 28.084935] ? rebalance_domains+0xcc0/0xcc0 [ 28.089314] ? pvclock_read_flags+0x160/0x160 [ 28.093776] ? pvclock_read_flags+0x160/0x160 [ 28.098235] ? __local_bh_enable+0x5f/0x70 [ 28.102440] ? __do_softirq+0x7a0/0xb85 [ 28.106383] ? lock_downgrade+0x990/0x990 [ 28.110496] ? __softirqentry_text_start+0x8/0x8 [ 28.115214] ? do_raw_spin_trylock+0x190/0x190 [ 28.119761] ? do_timer+0x50/0x50 [ 28.123179] ? tick_nohz_handler+0x130/0x130 [ 28.127551] ? native_apic_msr_write+0x5c/0x80 [ 28.132097] ? kvm_clock_get_cycles+0x25/0x30 [ 28.136560] ? clockevents_program_event+0x108/0x2e0 [ 28.141628] ? tick_program_event+0x7f/0xd0 [ 28.145914] ? do_softirq_own_stack+0x2a/0x40 [ 28.150391] __do_softirq+0x2d7/0xb85 [ 28.154198] ? __softirqentry_text_start+0x8/0x8 [ 28.158922] ? irq_exit+0xbb/0x200 [ 28.162430] ? smp_apic_timer_interrupt+0x177/0x710 [ 28.167412] ? smp_reschedule_interrupt+0xf2/0x670 [ 28.172314] ? smp_call_function_single_interrupt+0x650/0x650 [ 28.178164] ? _raw_spin_lock+0x32/0x40 [ 28.182108] ? handle_edge_irq+0x2b4/0x7c0 [ 28.186315] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 28.191126] do_softirq_own_stack+0x2a/0x40 [ 28.195410] [ 28.197614] do_softirq.part.22+0x14d/0x190 [ 28.201902] ? ip6_finish_output2+0xaf3/0x22a0 [ 28.206457] __local_bh_enable_ip+0x135/0x160 [ 28.210920] ip6_finish_output2+0xb26/0x22a0 [ 28.215299] ? ip6_copy_metadata+0x890/0x890 [ 28.219675] ? lock_acquire+0x1d5/0x580 [ 28.223615] ? lock_acquire+0x1d5/0x580 [ 28.227556] ? ip6_mtu+0x2a2/0x3e0 [ 28.231064] ? lock_downgrade+0x990/0x990 [ 28.235178] ? lock_release+0xa40/0xa40 [ 28.239119] ? ip6table_mangle_hook+0x113/0x910 [ 28.243771] ? ip6_mtu+0x112/0x3e0 [ 28.247274] ? ip6_dst_ifdown+0x3d0/0x3d0 [ 28.251384] ? lock_release+0xa40/0xa40 [ 28.255329] ip6_finish_output+0x2f9/0x920 [ 28.259529] ? ip6_finish_output+0x2f9/0x920 [ 28.263905] ip6_output+0x1f4/0x850 [ 28.267502] ? ip6_finish_output+0x920/0x920 [ 28.271879] ? lock_acquire+0x1d5/0x580 [ 28.275819] ? rawv6_sendmsg+0x1d56/0x3e40 [ 28.280020] ? ip6_fragment+0x3420/0x3420 [ 28.284133] ? lock_release+0xa40/0xa40 [ 28.288074] ip6_local_out+0x95/0x160 [ 28.291841] ip6_send_skb+0xa1/0x330 [ 28.295540] ip6_push_pending_frames+0xb3/0xe0 [ 28.300088] rawv6_sendmsg+0x2eb9/0x3e40 [ 28.304124] ? rawv6_bind+0x8c0/0x8c0 [ 28.307898] ? trace_hardirqs_off+0xd/0x10 [ 28.312099] ? kmem_cache_free+0x21b/0x280 [ 28.316301] ? lock_acquire+0x1d5/0x580 [ 28.320239] ? lock_acquire+0x1d5/0x580 [ 28.324177] ? __fget+0x333/0x570 [ 28.327597] ? lock_release+0xa40/0xa40 [ 28.331535] ? lock_downgrade+0x990/0x990 [ 28.335649] ? memset+0x31/0x40 [ 28.338984] ? fpstate_init+0xc0/0x160 [ 28.342847] ? iterate_fd+0x3f0/0x3f0 [ 28.346614] ? __might_fault+0x110/0x1d0 [ 28.350645] ? lock_acquire+0x1d5/0x580 [ 28.354582] ? lock_acquire+0x1d5/0x580 [ 28.358518] ? __might_fault+0x110/0x1d0 [ 28.362549] ? check_same_owner+0x320/0x320 [ 28.366836] ? __check_object_size+0x25d/0x4f0 [ 28.371389] inet_sendmsg+0x11f/0x5e0 [ 28.375153] ? inet_sendmsg+0x11f/0x5e0 [ 28.379092] ? __might_sleep+0x95/0x190 [ 28.383029] ? inet_recvmsg+0x5f0/0x5f0 [ 28.386968] ? selinux_socket_sendmsg+0x36/0x40 [ 28.391601] ? security_socket_sendmsg+0x89/0xb0 [ 28.396319] ? inet_recvmsg+0x5f0/0x5f0 [ 28.400258] sock_sendmsg+0xca/0x110 [ 28.403939] SYSC_sendto+0x352/0x5a0 [ 28.407619] ? SYSC_connect+0x470/0x470 [ 28.411563] ? mm_fault_error+0x2c0/0x2c0 [ 28.415675] ? do_raw_spin_trylock+0x190/0x190 [ 28.420219] ? lock_release+0xa40/0xa40 [ 28.424161] ? __do_page_fault+0xd60/0xd60 [ 28.428360] ? trace_event_raw_event_sys_exit+0x260/0x260 [ 28.433862] ? syscall_return_slowpath+0x2b3/0x510 [ 28.439507] ? finish_task_switch+0x1aa/0x740 [ 28.443971] ? prepare_exit_to_usermode+0x1a0/0x2d0 [ 28.448953] ? perf_trace_sys_enter+0xc20/0xc20 [ 28.453589] SyS_sendto+0x40/0x50 [ 28.457008] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 28.461729] RIP: 0033:0x4467c9 [ 28.464970] RSP: 002b:00007f93ea848cf8 EFLAGS: 00000212 ORIG_RAX: 000000000000002c [ 28.472642] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004467c9 [ 28.479876] RDX: 00000000000007f1 RSI: 000000002013b7ff RDI: 0000000000000003 [ 28.487123] RBP: 0000000000000000 R08: 00000000204e8fe4 R09: 000000000000001c [ 28.494360] R10: 0000000000000000 R11: 0000000000000212 R12: 0000000000000000 [ 28.501594] R13: 00007ffca6cb535f R14: 00007f93ea8499c0 R15: 0000000000000000 [ 28.508840] [ 28.510438] Allocated by task 2989: [ 28.514034] save_stack_trace+0x16/0x20 [ 28.517972] save_stack+0x43/0xd0 [ 28.521477] kasan_kmalloc+0xad/0xe0 [ 28.525156] __kmalloc_node_track_caller+0x47/0x70 [ 28.530053] __kmalloc_reserve.isra.40+0x41/0xd0 [ 28.534787] __alloc_skb+0x13b/0x780 [ 28.538469] sock_wmalloc+0x140/0x1d0 [ 28.542234] __ip6_append_data.isra.43+0x2681/0x3340 [ 28.547299] ip6_append_data+0x189/0x290 [ 28.551329] rawv6_sendmsg+0x1dd9/0x3e40 [ 28.555356] inet_sendmsg+0x11f/0x5e0 [ 28.559123] sock_sendmsg+0xca/0x110 [ 28.562972] SYSC_sendto+0x352/0x5a0 [ 28.566651] SyS_sendto+0x40/0x50 [ 28.570076] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 28.574794] [ 28.576387] Freed by task 2991: [ 28.579633] save_stack_trace+0x16/0x20 [ 28.583571] save_stack+0x43/0xd0 [ 28.586999] kasan_slab_free+0x71/0xc0 [ 28.590877] kfree+0xca/0x250 [ 28.593960] skb_free_head+0x74/0xb0 [ 28.597643] pskb_expand_head+0x36b/0x1210 [ 28.601845] __pskb_pull_tail+0x14a/0x17c0 [ 28.606059] xfrm_parse_spi+0x3d3/0x4d0 [ 28.609996] xfrm_input+0xce2/0x22f0 [ 28.613673] xfrm6_rcv_tnl+0x168/0x1d0 [ 28.617522] xfrm6_rcv+0x17/0x20 [ 28.620853] xfrm6_ah_rcv+0x166/0x300 [ 28.624618] ip6_input_finish+0x36f/0x1700 [ 28.628817] ip6_input+0xe9/0x560 [ 28.632233] ip6_rcv_finish+0x1a9/0x7a0 [ 28.636173] ipv6_rcv+0xf28/0x1f80 [ 28.639676] __netif_receive_skb_core+0x1a3e/0x34b0 [ 28.644656] __netif_receive_skb+0x2c/0x1b0 [ 28.648940] process_backlog+0x203/0x740 [ 28.652965] net_rx_action+0x792/0x1910 [ 28.656908] __do_softirq+0x2d7/0xb85 [ 28.660672] [ 28.662266] The buggy address belongs to the object at ffff8801d434e500 [ 28.662266] which belongs to the cache kmalloc-512 of size 512 [ 28.674887] The buggy address is located 56 bytes inside of [ 28.674887] 512-byte region [ffff8801d434e500, ffff8801d434e700) [ 28.686636] The buggy address belongs to the page: [ 28.691530] page:ffffea000750d380 count:1 mapcount:0 mapping:ffff8801d434e000 index:0x0