bisecting fixing commit since c70672d8d316ebd46ea447effadfe57ab7a30a50 building syzkaller on abf9ba4fc75d9b29af15625d44dcfc1360fad3b7 testing commit c70672d8d316ebd46ea447effadfe57ab7a30a50 with gcc (GCC) 8.4.1 20210217 kernel signature: 0649c3677b3b0c6035b8af7a3a002246418f0a2171562d553bdbb05af66f6618 run #0: crashed: KASAN: use-after-free Read in lock_sock_nested run #1: crashed: KASAN: use-after-free Read in lock_sock_nested run #2: crashed: KASAN: use-after-free Read in lock_sock_nested run #3: crashed: KASAN: use-after-free Read in lock_sock_nested run #4: crashed: KASAN: slab-out-of-bounds Read in lock_sock_nested run #5: crashed: KASAN: slab-out-of-bounds Read in lock_sock_nested run #6: crashed: KASAN: use-after-free Read in lock_sock_nested run #7: crashed: KASAN: use-after-free Read in lock_sock_nested run #8: crashed: KASAN: use-after-free Read in lock_sock_nested run #9: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #10: crashed: KASAN: use-after-free Read in lock_sock_nested run #11: crashed: KASAN: use-after-free Read in lock_sock_nested 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: WARNING: locking bug in l2cap_sock_teardown_cb run #15: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb run #16: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #17: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #18: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #19: crashed: KASAN: use-after-free Read in lock_sock_nested testing current HEAD bf05bf16c76bb44ab5156223e1e58e26dfe30a88 testing commit bf05bf16c76bb44ab5156223e1e58e26dfe30a88 with gcc (GCC) 10.2.1 20210217 kernel signature: b4b941e92fbc9855ae228a02361f338907e492ee9e524d0d5aa520310e354a61 run #0: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #1: crashed: KASAN: slab-out-of-bounds Read in lock_sock_nested run #2: crashed: KASAN: use-after-free Read in lock_sock_nested 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: null-ptr-deref Write in l2cap_chan_put run #6: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #7: crashed: KASAN: use-after-free Read in lock_sock_nested run #8: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put run #9: crashed: KASAN: null-ptr-deref Write in l2cap_chan_put revisions tested: 2, total time: 20m38.692518675s (build: 11m54.425607479s, test: 7m49.204454086s) the crash still happens on HEAD commit msg: Linux 5.12-rc8 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:220 [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:502 Write of size 4 at addr 0000000000000018 by task kworker/1:2/3302 CPU: 1 PID: 3302 Comm: kworker/1:2 Not tainted 5.12.0-rc8-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:79 [inline] dump_stack+0x10c/0x14b lib/dump_stack.c:120 __kasan_report mm/kasan/report.c:403 [inline] kasan_report.cold+0x5f/0xd8 mm/kasan/report.c:416 check_region_inline mm/kasan/generic.c:180 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:220 [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:502 l2cap_sock_kill+0x95/0x110 net/bluetooth/l2cap_sock.c:1217 l2cap_chan_timeout+0x171/0x3a0 net/bluetooth/l2cap_core.c:438 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 ================================================================== BUG: kernel NULL pointer dereference, address: 0000000000000018 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 104c64067 P4D 104c64067 PUD 116226067 PMD 0 Oops: 0002 [#1] PREEMPT SMP KASAN CPU: 1 PID: 3302 Comm: kworker/1:2 Tainted: G B 5.12.0-rc8-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:221 [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:502 Code: 89 ef e8 f2 a5 16 fb eb cb 41 56 be 04 00 00 00 41 55 41 54 4c 8d 67 18 55 48 89 fd 4c 89 e7 53 e8 44 a9 16 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:ffffc90000bf7ca0 EFLAGS: 00010246 RAX: 00000000ffffffff RBX: ffff88810a0ef110 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000001 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff12b1578 R11: 6e696c6261736944 R12: 0000000000000018 R13: ffff88810a0ef4b8 R14: ffffffff888876a0 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8881f6500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 0000000117bfb000 CR4: 0000000000350ee0 Call Trace: l2cap_sock_kill+0x95/0x110 net/bluetooth/l2cap_sock.c:1217 l2cap_chan_timeout+0x171/0x3a0 net/bluetooth/l2cap_core.c:438 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Modules linked in: CR2: 0000000000000018 ---[ end trace dbf4b048d2b6042a ]--- 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:221 [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:502 Code: 89 ef e8 f2 a5 16 fb eb cb 41 56 be 04 00 00 00 41 55 41 54 4c 8d 67 18 55 48 89 fd 4c 89 e7 53 e8 44 a9 16 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:ffffc90000bf7ca0 EFLAGS: 00010246 RAX: 00000000ffffffff RBX: ffff88810a0ef110 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000001 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff12b1578 R11: 6e696c6261736944 R12: 0000000000000018 R13: ffff88810a0ef4b8 R14: ffffffff888876a0 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8881f6500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 0000000117bfb000 CR4: 0000000000350ee0