bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on f721e4a097714a9054b9fe1aadf427afbbd2c157 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.1.0 kernel signature: ec6ddf6ffbfd401ad865efb703e89fba4f48742ab5b4779620886805e8561591 all runs: crashed: KASAN: use-after-free Read in lock_sock_nested testing current HEAD 6b6446efedb27c2766745a04f9b5d4449f51391d testing commit 6b6446efedb27c2766745a04f9b5d4449f51391d with gcc (GCC) 8.1.0 kernel signature: bbdd7fa770f2f528eaa7dfc31031c8321548724051a8bbc38ec8ea185f3e152e all runs: crashed: KASAN: use-after-free Read in lock_sock_nested revisions tested: 2, total time: 25m46.71155549s (build: 16m16.279930083s, test: 8m53.622215584s) the crash still happens on HEAD commit msg: Linux 4.14.204 crash: KASAN: use-after-free Read in lock_sock_nested ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x2cea/0x42d0 kernel/locking/lockdep.c:3369 Read of size 8 at addr ffff8880aa73a1a0 by task kworker/0:3/7049 CPU: 0 PID: 7049 Comm: kworker/0:3 Not tainted 4.14.204-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:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __lock_acquire+0x2cea/0x42d0 kernel/locking/lockdep.c:3369 lock_acquire+0x17e/0x3e0 kernel/locking/lockdep.c:3998 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:176 spin_lock_bh include/linux/spinlock.h:322 [inline] lock_sock_nested+0x3a/0x100 net/core/sock.c:2788 l2cap_sock_teardown_cb+0x7a/0x3e0 net/bluetooth/l2cap_sock.c:1341 l2cap_chan_close+0x3be/0x7e0 net/bluetooth/l2cap_core.c:761 l2cap_chan_timeout+0x10e/0x1b0 net/bluetooth/l2cap_core.c:430 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 10126: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15d/0x410 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] sk_prot_alloc+0x196/0x240 net/core/sock.c:1467 sk_alloc+0x34/0xc20 net/core/sock.c:1521 l2cap_sock_alloc.constprop.4+0x28/0x1e0 net/bluetooth/l2cap_sock.c:1618 l2cap_sock_create+0xb5/0x180 net/bluetooth/l2cap_sock.c:1664 bt_sock_create+0x121/0x260 net/bluetooth/af_bluetooth.c:130 __sock_create+0x262/0x540 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xd5/0x1e0 net/socket.c:1325 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 10126: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 sk_prot_free net/core/sock.c:1504 [inline] __sk_destruct+0x47e/0x5a0 net/core/sock.c:1582 sk_destruct+0x83/0xb0 net/core/sock.c:1597 __sk_free+0x47/0x1f0 net/core/sock.c:1605 sk_free+0x1a/0x20 net/core/sock.c:1616 sock_put include/net/sock.h:1662 [inline] l2cap_sock_kill.part.2+0x52/0x60 net/bluetooth/l2cap_sock.c:1056 l2cap_sock_kill net/bluetooth/l2cap_sock.c:1216 [inline] l2cap_sock_release+0x1ce/0x230 net/bluetooth/l2cap_sock.c:1210 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 get_signal+0x1460/0x1ab0 kernel/signal.c:2234 do_signal+0x7f/0x18b0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x11e/0x190 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880aa73a100 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff8880aa73a100, ffff8880aa73a900) The buggy address belongs to the page: page:ffffea0002a9ce80 count:1 mapcount:0 mapping:ffff8880aa73a100 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880aa73a100 0000000000000000 0000000100000003 raw: ffffea0002ad5da0 ffffea00024ade20 ffff8880b6400c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880aa73a080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880aa73a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880aa73a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880aa73a200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880aa73a280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================