================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295 Read of size 8 at addr ffff88804eb681e0 by task kworker/1:0/19 CPU: 1 PID: 19 Comm: kworker/1:0 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events sco_sock_timeout Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] sco_sock_timeout+0x7b/0x1b0 net/bluetooth/sco.c:95 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 23607: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc_track_caller+0x155/0x3c0 mm/slab.c:3742 __do_krealloc mm/slab_common.c:1501 [inline] krealloc+0x8c/0xc0 mm/slab_common.c:1548 snd_pcm_hw_rule_add+0x3ef/0x560 sound/core/pcm_lib.c:1137 snd_pcm_hw_constraints_init+0x7ef/0xc60 sound/core/pcm_native.c:2294 snd_pcm_open_substream+0x143/0x420 sound/core/pcm_native.c:2445 snd_pcm_open_file sound/core/pcm_native.c:2479 [inline] snd_pcm_open.part.0+0x213/0x650 sound/core/pcm_native.c:2546 snd_pcm_open sound/core/pcm_native.c:2536 [inline] snd_pcm_capture_open sound/core/pcm_native.c:2520 [inline] snd_pcm_capture_open+0xce/0x140 sound/core/pcm_native.c:2512 snd_open+0x212/0x440 sound/core/sound.c:175 chrdev_open+0x266/0x770 fs/char_dev.c:423 do_dentry_open+0x4aa/0x1160 fs/open.c:796 do_last fs/namei.c:3421 [inline] path_openat+0x793/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 23602: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 snd_pcm_detach_substream+0x12e/0x360 sound/core/pcm.c:1054 snd_pcm_release_substream sound/core/pcm_native.c:2409 [inline] snd_pcm_release+0xee/0x1f0 sound/core/pcm_native.c:2595 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88804eb68140 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff88804eb68140, ffff88804eb68940) The buggy address belongs to the page: page:ffffea00013ada00 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002d3d088 ffffea0002aee588 ffff88813bff0c40 raw: 0000000000000000 ffff88804eb68140 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804eb68080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804eb68100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88804eb68180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804eb68200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804eb68280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================