bisecting fixing commit since 961f830af0658ef5ef8a7708786d634a6115f16b building syzkaller on ff51e5229e0ee846d2fd687cb0dbca13de758c66 testing commit 961f830af0658ef5ef8a7708786d634a6115f16b with gcc (GCC) 8.1.0 kernel signature: 855a2f5ce042b7ce59d6e4b442bd177da9952b7d20daf39b34525618d17c5082 run #0: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put run #1: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put run #2: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put 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: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put run #6: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put run #7: crashed: KASAN: use-after-free Read in lock_sock_nested run #8: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put run #9: crashed: KASAN: use-after-free Read in lock_sock_nested testing current HEAD b94de4d19498b454645b72d08a05d32fa9074fb5 testing commit b94de4d19498b454645b72d08a05d32fa9074fb5 with gcc (GCC) 8.1.0 kernel signature: 805b53f929cd97495eb6f2a23a02c0f8d48fd43ad5ed60aea961d2e4b404b665 run #0: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put run #1: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put 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: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put run #5: crashed: KASAN: use-after-free Read in lock_sock_nested run #6: crashed: BUG: unable to handle kernel NULL pointer dereference in l2cap_chan_put 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: use-after-free Read in lock_sock_nested revisions tested: 2, total time: 29m12.044199175s (build: 17m28.521446977s, test: 11m5.401927952s) the crash still happens on HEAD commit msg: Linux 4.19.155 crash: KASAN: use-after-free Read in lock_sock_nested ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x31e1/0x47c0 kernel/locking/lockdep.c:3294 Read of size 8 at addr ffff888092064a20 by task kworker/0:2/2933 CPU: 0 PID: 2933 Comm: kworker/0:2 Not tainted 4.19.155-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:77 [inline] dump_stack+0x17c/0x22a lib/dump_stack.c:118 print_address_description.cold.6+0x9/0x211 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x307 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __lock_acquire+0x31e1/0x47c0 kernel/locking/lockdep.c:3294 lock_acquire+0x180/0x3a0 kernel/locking/lockdep.c:3907 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:168 spin_lock_bh include/linux/spinlock.h:334 [inline] lock_sock_nested+0x3a/0x100 net/core/sock.c:2864 l2cap_sock_teardown_cb+0x87/0x400 net/bluetooth/l2cap_sock.c:1340 l2cap_chan_close+0x3ef/0x830 net/bluetooth/l2cap_core.c:761 l2cap_chan_timeout+0x11d/0x1c0 net/bluetooth/l2cap_core.c:430 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 3718: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:553 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:538 __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15d/0x3d0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x198/0x240 net/core/sock.c:1466 sk_alloc+0x34/0xc70 net/core/sock.c:1520 __netlink_create+0x5c/0x250 net/netlink/af_netlink.c:643 netlink_create+0x220/0x530 net/netlink/af_netlink.c:706 __sock_create+0x262/0x540 net/socket.c:1276 sock_create net/socket.c:1316 [inline] __sys_socket+0xd7/0x1d0 net/socket.c:1346 __do_sys_socket net/socket.c:1355 [inline] __se_sys_socket net/socket.c:1353 [inline] __x64_sys_socket+0x6e/0xb0 net/socket.c:1353 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 0: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x13c/0x220 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 sk_prot_free net/core/sock.c:1503 [inline] __sk_destruct+0x452/0x600 net/core/sock.c:1584 sk_destruct+0x83/0xb0 net/core/sock.c:1599 __sk_free+0x9e/0x230 net/core/sock.c:1610 sk_free+0x1a/0x20 net/core/sock.c:1621 deferred_put_nlk_sk+0xe4/0x240 net/netlink/af_netlink.c:743 __rcu_reclaim kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2584 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline] rcu_process_callbacks+0x93a/0x19b0 kernel/rcu/tree.c:2881 __do_softirq+0x25e/0x92d kernel/softirq.c:292 The buggy address belongs to the object at ffff888092064980 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff888092064980, ffff888092065180) The buggy address belongs to the page: page:ffffea0002481900 count:1 mapcount:0 mapping:ffff88813be9cc40 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea00029e5b08 ffffea0002011b88 ffff88813be9cc40 raw: 0000000000000000 ffff888092064100 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888092064900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888092064980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888092064a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888092064a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888092064b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================