bisecting fixing commit since dcb8cfbd8fe9e62c7d64e82288d3ffe2502b7371 building syzkaller on 6affd8e838ce8a0c7d72445a7f67fe3bde8bbe04 testing commit dcb8cfbd8fe9e62c7d64e82288d3ffe2502b7371 with gcc (GCC) 8.1.0 run #0: crashed: KASAN: use-after-free Read in sock_def_write_space run #1: crashed: KASAN: use-after-free Read in sock_def_write_space run #2: crashed: KASAN: use-after-free Read in sock_def_write_space run #3: crashed: KASAN: use-after-free Read in sock_def_write_space run #4: crashed: KASAN: use-after-free Read in sock_def_write_space run #5: crashed: KASAN: use-after-free Read in sock_def_write_space run #6: crashed: KASAN: use-after-free Read in sock_def_write_space run #7: crashed: KASAN: use-after-free Read in sock_def_write_space run #8: OK run #9: OK testing current HEAD 089cf7f6ecb266b6a4164919a2e69bd2f938374a testing commit 089cf7f6ecb266b6a4164919a2e69bd2f938374a with gcc (GCC) 8.1.0 run #0: crashed: KASAN: use-after-free Read in sock_def_write_space run #1: crashed: KASAN: use-after-free Read in sock_def_write_space run #2: crashed: KASAN: use-after-free Read in sock_def_write_space run #3: crashed: KASAN: use-after-free Read in sock_def_write_space run #4: crashed: KASAN: use-after-free Read in sock_def_write_space run #5: crashed: KASAN: use-after-free Read in sock_def_write_space run #6: crashed: KASAN: use-after-free Read in sock_def_write_space run #7: crashed: KASAN: use-after-free Read in sock_def_write_space run #8: OK run #9: OK revisions tested: 2, total time: 33m22.821114189s (build: 11m22.805958348s, test: 20m40.805932895s) the crash still happens on HEAD crash: KASAN: use-after-free Read in sock_def_write_space ================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:199 [inline] BUG: KASAN: use-after-free in list_empty include/linux/list.h:268 [inline] BUG: KASAN: use-after-free in waitqueue_active include/linux/wait.h:126 [inline] BUG: KASAN: use-after-free in wq_has_sleeper include/linux/wait.h:160 [inline] BUG: KASAN: use-after-free in skwq_has_sleeper include/net/sock.h:2088 [inline] BUG: KASAN: use-after-free in sock_def_write_space+0x486/0x4b0 net/core/sock.c:2803 Read of size 8 at addr ffff8880890baaf8 by task syz-executor.1/8989 CPU: 1 PID: 8989 Comm: syz-executor.1 Not tainted 5.3.0-rc7 #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+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x318 mm/kasan/report.c:351 __kasan_report.cold.9+0x1b/0x3f mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 __read_once_size include/linux/compiler.h:199 [inline] list_empty include/linux/list.h:268 [inline] waitqueue_active include/linux/wait.h:126 [inline] wq_has_sleeper include/linux/wait.h:160 [inline] skwq_has_sleeper include/net/sock.h:2088 [inline] sock_def_write_space+0x486/0x4b0 net/core/sock.c:2803 sock_wfree+0xf5/0x140 net/core/sock.c:1950 skb_release_head_state+0x9f/0x1a0 net/core/skbuff.c:652 skb_release_all+0xd/0x50 net/core/skbuff.c:663 _kfree_skb_defer net/core/skbuff.c:873 [inline] napi_consume_skb+0x129/0x430 net/core/skbuff.c:918 free_old_xmit_skbs+0xbc/0x1f0 drivers/net/virtio_net.c:1366 virtnet_poll_tx+0x1e5/0x360 drivers/net/virtio_net.c:1493 napi_poll net/core/dev.c:6352 [inline] net_rx_action+0x458/0xe00 net/core/dev.c:6418 __do_softirq+0x262/0x9a8 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19a/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:537 [inline] do_IRQ+0x12b/0x1f0 arch/x86/kernel/irq.c:259 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:607 RIP: 0010:remove_wait_queue+0x0/0x1b0 kernel/sched/wait.c:41 Code: 4c 89 8d 70 ff ff ff e8 ee f4 4b 00 48 8b 8d 68 ff ff ff 4c 8b 8d 70 ff ff ff e9 f2 fd ff ff 90 66 2e 0f 1f 84 00 00 00 00 00 <55> 48 89 e5 41 57 41 56 49 89 fe 41 55 41 54 53 48 89 f3 4c 8d 63 RSP: 0018:ffff888098907c30 EFLAGS: 00000282 ORIG_RAX: ffffffffffffffd9 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffff888098907d2c RDX: 1ffff110123a254a RSI: ffff888098907d50 RDI: ffff8880970540e0 RBP: ffff888098907cf8 R08: fffffbfff1041219 R09: fffffbfff1041219 R10: fffffbfff1041218 R11: ffffffff882090c3 R12: ffff888091d12340 R13: ffff888091d12860 R14: ffff888091d12330 R15: ffff888091d12340 kernel_wait4+0xf9/0x1d0 kernel/exit.c:1671 __do_sys_wait4+0xe0/0xf0 kernel/exit.c:1683 __se_sys_wait4 kernel/exit.c:1679 [inline] __x64_sys_wait4+0x92/0xf0 kernel/exit.c:1679 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4137ba Code: 0f 83 6a 18 00 00 c3 66 0f 1f 84 00 00 00 00 00 8b 05 de 2a 66 00 85 c0 75 36 45 31 d2 48 63 d2 48 63 ff b8 3d 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 d4 ff ff ff f7 RSP: 002b:00007ffd6260c228 EFLAGS: 00000246 ORIG_RAX: 000000000000003d RAX: ffffffffffffffda RBX: 00000000000548a5 RCX: 00000000004137ba RDX: 0000000040000001 RSI: 00007ffd6260c260 RDI: ffffffffffffffff RBP: 0000000000001a1e R08: 0000000000000001 R09: 00005555568d3940 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000007 R13: 00007ffd6260c260 R14: 000000000005486d R15: 00007ffd6260c270 Allocated by task 28462: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.9+0xc7/0xd0 mm/kasan/common.c:493 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:501 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x750 mm/slab.c:3483 sock_alloc_inode+0x16/0x1a0 net/socket.c:239 alloc_inode+0x5c/0x1a0 fs/inode.c:227 new_inode_pseudo+0xc/0xd0 fs/inode.c:916 sock_alloc+0x3c/0x270 net/socket.c:558 __sock_create+0x7a/0x540 net/socket.c:1382 sock_create net/socket.c:1469 [inline] __sys_socket+0xd7/0x1c0 net/socket.c:1511 __do_sys_socket net/socket.c:1520 [inline] __se_sys_socket net/socket.c:1518 [inline] __x64_sys_socket+0x6e/0xb0 net/socket.c:1518 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x83/0x320 mm/slab.c:3693 sock_free_inode+0x17/0x20 net/socket.c:260 i_callback+0x3c/0x70 fs/inode.c:216 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2114 [inline] rcu_core+0x65e/0x14c0 kernel/rcu/tree.c:2314 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2323 __do_softirq+0x262/0x9a8 kernel/softirq.c:292 The buggy address belongs to the object at ffff8880890baa80 which belongs to the cache sock_inode_cache(17:syz2) of size 1152 The buggy address is located 120 bytes inside of 1152-byte region [ffff8880890baa80, ffff8880890baf00) The buggy address belongs to the page: page:ffffea0002242e80 refcount:1 mapcount:0 mapping:ffff8880a85cc000 index:0xffff8880890baffd flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002242e48 ffffea0002685f08 ffff8880a85cc000 raw: ffff8880890baffd ffff8880890ba080 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880890ba980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880890baa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880890baa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880890bab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880890bab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================