bisecting fixing commit since c70672d8d316ebd46ea447effadfe57ab7a30a50 building syzkaller on abf9ba4fc75d9b29af15625d44dcfc1360fad3b7 testing commit c70672d8d316ebd46ea447effadfe57ab7a30a50 compiler: gcc (GCC) 8.4.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 0649c3677b3b0c6035b8af7a3a002246418f0a2171562d553bdbb05af66f6618 run #0: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #1: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #2: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #3: crashed: KASAN: use-after-free Read in lock_sock_nested run #4: crashed: KASAN: use-after-free Read in lock_sock_nested run #5: crashed: KASAN: use-after-free Read in lock_sock_nested run #6: crashed: KASAN: use-after-free Read in lock_sock_nested run #7: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #8: crashed: KASAN: use-after-free Read in lock_sock_nested run #9: crashed: KASAN: use-after-free Read in lock_sock_nested run #10: crashed: KASAN: use-after-free Read in lock_sock_nested run #11: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb run #12: crashed: KASAN: use-after-free Read in lock_sock_nested run #13: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #14: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb run #15: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #16: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #17: crashed: KASAN: slab-out-of-bounds Read in lock_sock_nested run #18: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb run #19: crashed: KASAN: use-after-free Read in lock_sock_nested testing current HEAD 73f3af7b4611d77bdaea303fb639333eb28e37d7 testing commit 73f3af7b4611d77bdaea303fb639333eb28e37d7 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 75a41784105041491f34768a9fe56194fdcd2e68b835d3c47b3dd1543406834c run #0: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #1: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #2: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #3: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #4: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #5: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #6: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #7: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #8: boot failed: create image operation failed: &{Code:ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS Location: Message:The zone 'projects/syzkaller/zones/us-central1-c' does not have enough resources available to fulfill the request. '(resource type:compute)'. ForceSendFields:[] NullFields:[]}. run #9: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put revisions tested: 2, total time: 24m57.246447803s (build: 16m25.321312603s, test: 7m32.98263759s) the crash still happens on HEAD commit msg: Merge branch 'akpm' (patches from Andrew) crash: KASAN: null-ptr-deref Write in l2cap_chan_put ================================================================== BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: null-ptr-deref in atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:167 [inline] BUG: KASAN: null-ptr-deref in __refcount_sub_and_test include/linux/refcount.h:272 [inline] BUG: KASAN: null-ptr-deref in __refcount_dec_and_test include/linux/refcount.h:315 [inline] BUG: KASAN: null-ptr-deref in refcount_dec_and_test include/linux/refcount.h:333 [inline] BUG: KASAN: null-ptr-deref in kref_put include/linux/kref.h:64 [inline] BUG: KASAN: null-ptr-deref in l2cap_chan_put+0x1c/0x1c0 net/bluetooth/l2cap_core.c:504 Write of size 4 at addr 0000000000000018 by task kworker/0:2/2462 CPU: 0 PID: 2462 Comm: kworker/0:2 Not tainted 5.14.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xbd/0xe2 lib/dump_stack.c:105 __kasan_report mm/kasan/report.c:423 [inline] kasan_report.cold+0x66/0xdf mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:167 [inline] __refcount_sub_and_test include/linux/refcount.h:272 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] kref_put include/linux/kref.h:64 [inline] l2cap_chan_put+0x1c/0x1c0 net/bluetooth/l2cap_core.c:504 l2cap_sock_kill+0x95/0x110 net/bluetooth/l2cap_sock.c:1225 l2cap_chan_timeout+0x171/0x3a0 net/bluetooth/l2cap_core.c:438 process_one_work+0x84c/0x13d0 kernel/workqueue.c:2276 worker_thread+0x598/0x1040 kernel/workqueue.c:2422 kthread+0x38b/0x460 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 ================================================================== BUG: kernel NULL pointer dereference, address: 0000000000000018 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP KASAN CPU: 0 PID: 2462 Comm: kworker/0:2 Tainted: G B 5.14.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout RIP: 0010:arch_atomic_fetch_sub arch/x86/include/asm/atomic.h:190 [inline] RIP: 0010:atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:168 [inline] RIP: 0010:__refcount_sub_and_test include/linux/refcount.h:272 [inline] RIP: 0010:__refcount_dec_and_test include/linux/refcount.h:315 [inline] RIP: 0010:refcount_dec_and_test include/linux/refcount.h:333 [inline] RIP: 0010:kref_put include/linux/kref.h:64 [inline] RIP: 0010:l2cap_chan_put+0x21/0x1c0 net/bluetooth/l2cap_core.c:504 Code: 25 02 03 fb eb ad 0f 1f 00 41 56 be 04 00 00 00 41 55 41 54 4c 8d 67 18 55 48 89 fd 4c 89 e7 53 e8 84 05 03 fb b8 ff ff ff ff 0f c1 45 18 83 f8 01 74 11 85 c0 0f 8e 2b 01 00 00 5b 5d 41 5c RSP: 0018:ffffc90007cc7ca8 EFLAGS: 00010246 RAX: 00000000ffffffff RBX: ffff88812f9d3110 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000001 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff12f2e08 R11: 6e696c6261736944 R12: 0000000000000018 R13: ffff88812f9d34b8 R14: ffffffff88ab3700 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f6400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 0000000125b2a000 CR4: 0000000000350ef0 Call Trace: l2cap_sock_kill+0x95/0x110 net/bluetooth/l2cap_sock.c:1225 l2cap_chan_timeout+0x171/0x3a0 net/bluetooth/l2cap_core.c:438 process_one_work+0x84c/0x13d0 kernel/workqueue.c:2276 worker_thread+0x598/0x1040 kernel/workqueue.c:2422 kthread+0x38b/0x460 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Modules linked in: CR2: 0000000000000018 ---[ end trace 4088e2fdcce3a7e9 ]--- RIP: 0010:arch_atomic_fetch_sub arch/x86/include/asm/atomic.h:190 [inline] RIP: 0010:atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:168 [inline] RIP: 0010:__refcount_sub_and_test include/linux/refcount.h:272 [inline] RIP: 0010:__refcount_dec_and_test include/linux/refcount.h:315 [inline] RIP: 0010:refcount_dec_and_test include/linux/refcount.h:333 [inline] RIP: 0010:kref_put include/linux/kref.h:64 [inline] RIP: 0010:l2cap_chan_put+0x21/0x1c0 net/bluetooth/l2cap_core.c:504 Code: 25 02 03 fb eb ad 0f 1f 00 41 56 be 04 00 00 00 41 55 41 54 4c 8d 67 18 55 48 89 fd 4c 89 e7 53 e8 84 05 03 fb b8 ff ff ff ff 0f c1 45 18 83 f8 01 74 11 85 c0 0f 8e 2b 01 00 00 5b 5d 41 5c RSP: 0018:ffffc90007cc7ca8 EFLAGS: 00010246 RAX: 00000000ffffffff RBX: ffff88812f9d3110 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000001 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff12f2e08 R11: 6e696c6261736944 R12: 0000000000000018 R13: ffff88812f9d34b8 R14: ffffffff88ab3700 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f6400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 0000000125b2a000 CR4: 0000000000350ef0 ---------------- Code disassembly (best guess): 0: 25 02 03 fb eb and $0xebfb0302,%eax 5: ad lods %ds:(%rsi),%eax 6: 0f 1f 00 nopl (%rax) 9: 41 56 push %r14 b: be 04 00 00 00 mov $0x4,%esi 10: 41 55 push %r13 12: 41 54 push %r12 14: 4c 8d 67 18 lea 0x18(%rdi),%r12 18: 55 push %rbp 19: 48 89 fd mov %rdi,%rbp 1c: 4c 89 e7 mov %r12,%rdi 1f: 53 push %rbx 20: e8 84 05 03 fb callq 0xfb0305a9 25: b8 ff ff ff ff mov $0xffffffff,%eax * 2a: f0 0f c1 45 18 lock xadd %eax,0x18(%rbp) <-- trapping instruction 2f: 83 f8 01 cmp $0x1,%eax 32: 74 11 je 0x45 34: 85 c0 test %eax,%eax 36: 0f 8e 2b 01 00 00 jle 0x167 3c: 5b pop %rbx 3d: 5d pop %rbp 3e: 41 5c pop %r12