bisecting fixing commit since a409ed156a90093a03fe6a93721ddf4c591eac87 building syzkaller on 04201c0669446145fd9c347c5538da0ca13ff29b testing commit a409ed156a90093a03fe6a93721ddf4c591eac87 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 20dbe22dfa59437a72607f9f2a622274b13fa76847bf67d4e3dbc7ebcdb0ebf3 run #0: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb run #1: crashed: KASAN: use-after-free Read in lock_sock_nested run #2: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb run #3: crashed: KASAN: slab-out-of-bounds 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: WARNING: locking bug in l2cap_sock_teardown_cb run #7: crashed: WARNING: locking bug in l2cap_sock_teardown_cb run #8: crashed: WARNING: locking bug in l2cap_sock_teardown_cb run #9: crashed: KASAN: use-after-free Read in lock_sock_nested run #10: crashed: WARNING: locking bug in l2cap_sock_teardown_cb run #11: crashed: KASAN: slab-out-of-bounds Read in lock_sock_nested run #12: crashed: KASAN: use-after-free Read in lock_sock_nested run #13: crashed: KASAN: use-after-free Read in lock_sock_nested run #14: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb run #15: crashed: KASAN: use-after-free Read in lock_sock_nested run #16: crashed: KASAN: use-after-free Read in lock_sock_nested run #17: crashed: WARNING: locking bug in l2cap_sock_teardown_cb run #18: crashed: WARNING: locking bug in l2cap_sock_teardown_cb run #19: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb testing current HEAD 9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef testing commit 9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 5d018aa05b40f44033389ad9cb5a6591607a0b8e7eb21178cef6533536d8f3ec run #0: crashed: KASAN: use-after-free Read in lock_sock_nested run #1: crashed: BUG: unable to handle kernel paging request in lock_sock_nested run #2: crashed: BUG: spinlock bad magic in lock_sock_nested run #3: crashed: KASAN: use-after-free Read in lock_sock_nested run #4: crashed: BUG: spinlock bad magic in lock_sock_nested run #5: crashed: INFO: trying to register non-static key in l2cap_sock_teardown_cb 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: use-after-free Read in lock_sock_nested revisions tested: 2, total time: 20m56.091554843s (build: 11m58.055190678s, test: 8m7.614716061s) the crash still happens on HEAD commit msg: Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux crash: KASAN: use-after-free Read in lock_sock_nested ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d1f/0x53d0 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff8880122aa0a0 by task kworker/0:3/2974 CPU: 0 PID: 2974 Comm: kworker/0:3 Not tainted 5.14.0-rc6-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+0x45/0x59 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x2d6 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 __lock_acquire+0x3d1f/0x53d0 kernel/locking/lockdep.c:4885 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x500 kernel/locking/lockdep.c:5590 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:359 [inline] lock_sock_nested+0x39/0xf0 net/core/sock.c:3162 l2cap_sock_teardown_cb+0x90/0x590 net/bluetooth/l2cap_sock.c:1528 l2cap_chan_del+0x9b/0x8f0 net/bluetooth/l2cap_core.c:622 l2cap_chan_close+0x180/0x990 net/bluetooth/l2cap_core.c:825 l2cap_chan_timeout+0x125/0x280 net/bluetooth/l2cap_core.c:436 process_one_work+0x84c/0x13f0 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 Allocated by task 4880: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0x7a/0x90 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __do_kmalloc mm/slab.c:3702 [inline] __kmalloc+0x193/0x380 mm/slab.c:3711 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xee/0x200 net/core/sock.c:1808 sk_alloc+0x27/0x920 net/core/sock.c:1861 __netlink_create+0x58/0x2d0 net/netlink/af_netlink.c:640 netlink_create+0x305/0x540 net/netlink/af_netlink.c:703 __sock_create+0x24b/0x5c0 net/socket.c:1450 sock_create net/socket.c:1501 [inline] __sys_socket+0xd6/0x1a0 net/socket.c:1543 __do_sys_socket net/socket.c:1552 [inline] __se_sys_socket net/socket.c:1550 [inline] __x64_sys_socket+0x6a/0xb0 net/socket.c:1550 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 0: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xb2/0xe0 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] __cache_free mm/slab.c:3445 [inline] kfree+0xe8/0x270 mm/slab.c:3803 sk_prot_free net/core/sock.c:1844 [inline] __sk_destruct+0x5cf/0x740 net/core/sock.c:1929 rcu_do_batch kernel/rcu/tree.c:2550 [inline] rcu_core+0x771/0x12f0 kernel/rcu/tree.c:2785 __do_softirq+0x29b/0xa0c kernel/softirq.c:558 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0x87/0xb0 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3029 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3109 netlink_release+0xb5c/0x18a0 net/netlink/af_netlink.c:812 __sock_release+0xbb/0x270 net/socket.c:648 sock_close+0xf/0x20 net/socket.c:1300 __fput+0x209/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x9fe/0x24f0 kernel/exit.c:825 do_group_exit+0xe7/0x290 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x35/0x40 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880122aa000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff8880122aa000, ffff8880122aa800) The buggy address belongs to the page: page:0000000022c454ef refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122aa flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00007af348 ffffea00007bb108 ffff88800f440800 raw: 0000000000000000 ffff8880122aa000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880122a9f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880122aa000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880122aa080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880122aa100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880122aa180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================