bisecting fixing commit since cbfa1702aaf69b2311ea1b35e04f113c48368c67 building syzkaller on 3e8f6c27551f163a2fd2661e4b3cac126a5e7ef2 testing commit cbfa1702aaf69b2311ea1b35e04f113c48368c67 with gcc (GCC) 8.1.0 kernel signature: 5535b72cf8a80e47b896943898888471834d02ae1985fd7254107a7cea53c0fc run #0: crashed: KASAN: use-after-free Read in __netif_receive_skb_core run #1: crashed: KASAN: use-after-free Read in packet_rcv run #2: crashed: KASAN: use-after-free Read in __netif_receive_skb_core run #3: OK run #4: crashed: KASAN: use-after-free Read in __netif_receive_skb_core run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK testing current HEAD 2b79150141611d3c6e1b55d4e70f49602482f0b8 testing commit 2b79150141611d3c6e1b55d4e70f49602482f0b8 with gcc (GCC) 8.1.0 kernel signature: 52971d01a911d502ba941b7520ec3282943f68427014f0aa9e7a6e7ca331f0ff run #0: crashed: KASAN: use-after-free Read in __netif_receive_skb_core run #1: crashed: KASAN: use-after-free Read in __netif_receive_skb_core run #2: crashed: KASAN: use-after-free Read in __netif_receive_skb_core run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK revisions tested: 2, total time: 35m55.273207752s (build: 16m14.820839779s, test: 19m4.689904711s) the crash still happens on HEAD commit msg: Linux 4.14.203 crash: KASAN: use-after-free Read in __netif_receive_skb_core ================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline] BUG: KASAN: use-after-free in deliver_ptype_list_skb net/core/dev.c:1888 [inline] BUG: KASAN: use-after-free in __netif_receive_skb_core+0x226f/0x2f80 net/core/dev.c:4462 Read of size 8 at addr ffff8880a0025a28 by task syz-executor.2/18973 CPU: 0 PID: 18973 Comm: syz-executor.2 Not tainted 4.14.203-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __read_once_size include/linux/compiler.h:183 [inline] deliver_ptype_list_skb net/core/dev.c:1888 [inline] __netif_receive_skb_core+0x226f/0x2f80 net/core/dev.c:4462 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:4512 process_backlog+0x220/0x710 net/core/dev.c:5194 napi_poll net/core/dev.c:5596 [inline] net_rx_action+0x456/0xed0 net/core/dev.c:5662 __do_softirq+0x246/0x9b5 kernel/softirq.c:288 invoke_softirq kernel/softirq.c:368 [inline] irq_exit+0x15f/0x1a0 kernel/softirq.c:409 exiting_irq arch/x86/include/asm/apic.h:648 [inline] smp_apic_timer_interrupt+0x145/0x5d0 arch/x86/kernel/apic/apic.c:1102 apic_timer_interrupt+0x9a/0xa0 arch/x86/entry/entry_64.S:793 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline] RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xaf/0xd0 kernel/locking/spinlock.c:192 RSP: 0018:ffff8880a400efb0 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff10 RAX: dffffc0000000000 RBX: 0000000000000286 RCX: 1ffff1101333096d RDX: 1ffffffff0fe2bc1 RSI: ffff888099984b70 RDI: 0000000000000286 RBP: ffff8880a400efc0 R08: ffff888099984b68 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff87f87460 R13: 0000000000000286 R14: ffffffff87f860d0 R15: ffffffff87f860e8 swake_up+0x4b/0x60 kernel/sched/swait.c:39 __rcu_report_exp_rnp+0x208/0x2d0 kernel/rcu/tree_exp.h:185 rcu_report_exp_rnp kernel/rcu/tree_exp.h:210 [inline] rcu_read_unlock_special+0x76c/0xd50 kernel/rcu/tree_plugin.h:540 __rcu_read_unlock+0x161/0x170 kernel/rcu/update.c:260 rcu_read_unlock include/linux/rcupdate.h:684 [inline] ip_queue_xmit+0x72b/0x1d50 net/ipv4/ip_output.c:506 __tcp_transmit_skb+0x17df/0x3570 net/ipv4/tcp_output.c:1133 tcp_transmit_skb net/ipv4/tcp_output.c:1149 [inline] __tcp_retransmit_skb+0x673/0x2210 net/ipv4/tcp_output.c:2943 tcp_retransmit_skb+0x1d/0x200 net/ipv4/tcp_output.c:2957 tcp_xmit_retransmit_queue.part.11+0x14a/0x710 net/ipv4/tcp_output.c:3050 tcp_xmit_retransmit_queue+0x47/0x60 net/ipv4/tcp_output.c:2997 tcp_xmit_recovery.part.27+0x17/0xe0 net/ipv4/tcp_input.c:3578 tcp_xmit_recovery net/ipv4/tcp_input.c:3568 [inline] tcp_ack+0x2008/0x4b90 net/ipv4/tcp_input.c:3707 tcp_rcv_established+0x44d/0x1b70 net/ipv4/tcp_input.c:5570 tcp_v4_do_rcv+0x51e/0x780 net/ipv4/tcp_ipv4.c:1476 sk_backlog_rcv include/net/sock.h:921 [inline] __release_sock+0x10e/0x2f0 net/core/sock.c:2269 release_sock+0x4f/0x180 net/core/sock.c:2805 sk_stream_wait_memory+0x44c/0xd10 net/core/stream.c:145 tcp_sendmsg_locked+0x114d/0x3be0 net/ipv4/tcp.c:1416 tcp_sendmsg+0x27/0x40 net/ipv4/tcp.c:1457 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:656 SYSC_sendto net/socket.c:1763 [inline] SyS_sendto+0x1e4/0x2c0 net/socket.c:1731 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45e179 RSP: 002b:00007fa2e0749c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000002d200 RCX: 000000000045e179 RDX: 000000000000fe6a RSI: 00000000200012c0 RDI: 0000000000000004 RBP: 000000000118cf98 R08: 0000000000000000 R09: 0000000000000027 R10: 000000000020c49a R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffdff882bff R14: 00007fa2e074a9c0 R15: 000000000118cf4c Allocated by task 18986: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15d/0x410 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] sk_prot_alloc+0x196/0x240 net/core/sock.c:1467 sk_alloc+0x34/0xc20 net/core/sock.c:1521 packet_create+0xe1/0x780 net/packet/af_packet.c:3295 __sock_create+0x262/0x540 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xd5/0x1e0 net/socket.c:1325 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 18946: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 sk_prot_free net/core/sock.c:1504 [inline] __sk_destruct+0x47e/0x5a0 net/core/sock.c:1582 sk_destruct+0x83/0xb0 net/core/sock.c:1597 __sk_free+0x47/0x1f0 net/core/sock.c:1605 sk_free+0x1a/0x20 net/core/sock.c:1616 sock_put include/net/sock.h:1662 [inline] packet_release+0x7bb/0xa60 net/packet/af_packet.c:3124 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x14a/0x190 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880a0025240 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 2024 bytes inside of 2048-byte region [ffff8880a0025240, ffff8880a0025a40) The buggy address belongs to the page: page:ffffea0002800900 count:1 mapcount:0 mapping:ffff8880a0024140 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880a0024140 0000000000000000 0000000100000003 raw: ffffea00027eeaa0 ffffea000287f420 ffff8880b6400c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a0025900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a0025980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a0025a00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880a0025a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a0025b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================