================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1375 [inline] BUG: KASAN: slab-use-after-free in hci_conn_drop+0x34/0x2bc include/net/bluetooth/hci_core.h:1523 Write of size 4 at addr ffff0000cc446010 by task syz-executor.0/10841 CPU: 1 PID: 10841 Comm: syz-executor.0 Not tainted 6.6.0-rc4-syzkaller-g19af4a4ed414 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x174/0x514 mm/kasan/report.c:475 kasan_report+0xd8/0x138 mm/kasan/report.c:588 kasan_check_range+0x254/0x294 mm/kasan/generic.c:187 __kasan_check_write+0x20/0x30 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1375 [inline] hci_conn_drop+0x34/0x2bc include/net/bluetooth/hci_core.h:1523 __sco_sock_close+0x3a8/0x7b0 net/bluetooth/sco.c:444 sco_sock_close net/bluetooth/sco.c:469 [inline] sco_sock_release+0xb4/0x2c0 net/bluetooth/sco.c:1246 __sock_release net/socket.c:659 [inline] sock_close+0xa4/0x1e8 net/socket.c:1402 __fput+0x324/0x7f8 fs/file_table.c:384 __fput_sync+0x60/0x9c fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __arm64_sys_close+0x150/0x1e0 fs/open.c:1557 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Allocated by task 10846: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:511 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] kmalloc_trace+0x70/0x88 mm/slab_common.c:1119 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] hci_conn_add+0xcc/0x11e4 net/bluetooth/hci_conn.c:957 hci_connect_sco+0x94/0x2bc net/bluetooth/hci_conn.c:1692 sco_connect net/bluetooth/sco.c:266 [inline] sco_sock_connect+0x268/0x80c net/bluetooth/sco.c:591 __sys_connect_file net/socket.c:2033 [inline] __sys_connect+0x268/0x290 net/socket.c:2050 __do_sys_connect net/socket.c:2060 [inline] __se_sys_connect net/socket.c:2057 [inline] __arm64_sys_connect+0x7c/0x94 net/socket.c:2057 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Freed by task 6058: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:522 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x2ac/0x480 mm/slub.c:3822 kfree+0xb8/0x19c mm/slab_common.c:1072 bt_link_release+0x20/0x30 net/bluetooth/hci_sysfs.c:16 device_release+0x8c/0x1ac kobject_cleanup lib/kobject.c:682 [inline] kobject_release lib/kobject.c:716 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c4/0x3c4 lib/kobject.c:733 put_device+0x28/0x40 drivers/base/core.c:3732 hci_conn_put include/net/bluetooth/hci_core.h:1506 [inline] hci_conn_cleanup net/bluetooth/hci_conn.c:178 [inline] hci_conn_del+0x78c/0xa90 net/bluetooth/hci_conn.c:1156 hci_conn_failed+0x204/0x2a4 net/bluetooth/hci_conn.c:1252 hci_abort_conn_sync+0x8a8/0xd90 net/bluetooth/hci_sync.c:5435 abort_conn_sync+0x5c/0x8c net/bluetooth/hci_conn.c:2894 hci_cmd_sync_work+0x1d8/0x30c net/bluetooth/hci_sync.c:306 process_one_work+0x694/0x1204 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2784 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857 The buggy address belongs to the object at ffff0000cc446000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 16 bytes inside of freed 4096-byte region [ffff0000cc446000, ffff0000cc447000) The buggy address belongs to the physical page: page:00000000a3581daf refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10c440 head:00000000a3581daf order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c0002140 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cc445f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000cc445f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000cc446000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cc446080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cc446100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ ODEBUG: assert_init not available (active state 0) object: 000000004d975515 object type: timer_list hint: hci_conn_timeout+0x0/0x46c net/bluetooth/hci_conn.c:928 WARNING: CPU: 1 PID: 10841 at lib/debugobjects.c:517 debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 Modules linked in: CPU: 1 PID: 10841 Comm: syz-executor.0 Tainted: G B 6.6.0-rc4-syzkaller-g19af4a4ed414 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 lr : debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 sp : ffff8000a6697790 x29: ffff8000a6697790 x28: dfff800000000000 x27: ffff700014cd2f00 x26: ffff0000dbb0d4e8 x25: dfff800000000000 x24: ffff0000cc446390 x23: ffff80008ac76520 x22: ffff80008979b608 x21: ffff80008a7ac360 x20: 0000000000000000 x19: ffff80008ac76040 x18: 0000000000000000 x17: 0000000000000000 x16: ffff80008a5793a0 x15: 0000000000000001 x14: 1ffff00014cd2e0c x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000001 x10: 0000000000000000 x9 : 1b0c71b94ecc0900 x8 : 1b0c71b94ecc0900 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000a6697078 x4 : ffff80008e280fe0 x3 : ffff80008036c664 x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000000 Call trace: debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 debug_object_assert_init+0x318/0x3c8 lib/debugobjects.c:941 debug_timer_assert_init kernel/time/timer.c:792 [inline] debug_assert_init kernel/time/timer.c:837 [inline] __timer_delete+0xac/0x2f8 kernel/time/timer.c:1321 timer_delete+0x24/0x34 kernel/time/timer.c:1361 del_timer include/linux/timer.h:213 [inline] try_to_grab_pending+0x8c/0x618 kernel/workqueue.c:1564 __cancel_work+0xb0/0x2a8 kernel/workqueue.c:3582 cancel_delayed_work+0x24/0x38 kernel/workqueue.c:3620 hci_conn_drop+0x150/0x2bc include/net/bluetooth/hci_core.h:1548 __sco_sock_close+0x3a8/0x7b0 net/bluetooth/sco.c:444 sco_sock_close net/bluetooth/sco.c:469 [inline] sco_sock_release+0xb4/0x2c0 net/bluetooth/sco.c:1246 __sock_release net/socket.c:659 [inline] sock_close+0xa4/0x1e8 net/socket.c:1402 __fput+0x324/0x7f8 fs/file_table.c:384 __fput_sync+0x60/0x9c fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __arm64_sys_close+0x150/0x1e0 fs/open.c:1557 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 irq event stamp: 9707 hardirqs last enabled at (9707): [] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline] hardirqs last enabled at (9707): [] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:94 hardirqs last disabled at (9706): [] __do_softirq+0x950/0xd54 kernel/softirq.c:569 softirqs last enabled at (9428): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (9428): [] lock_sock_nested+0xcc/0x11c net/core/sock.c:3512 softirqs last disabled at (9426): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (9426): [] lock_sock_nested+0x74/0x11c net/core/sock.c:3508 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ WARNING: CPU: 1 PID: 10841 at kernel/workqueue.c:1939 __queue_delayed_work kernel/workqueue.c:1939 [inline] WARNING: CPU: 1 PID: 10841 at kernel/workqueue.c:1939 queue_delayed_work_on+0x214/0x2e4 kernel/workqueue.c:1986 Modules linked in: CPU: 1 PID: 10841 Comm: syz-executor.0 Tainted: G B W 6.6.0-rc4-syzkaller-g19af4a4ed414 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __queue_delayed_work kernel/workqueue.c:1939 [inline] pc : queue_delayed_work_on+0x214/0x2e4 kernel/workqueue.c:1986 lr : __queue_delayed_work kernel/workqueue.c:1939 [inline] lr : queue_delayed_work_on+0x214/0x2e4 kernel/workqueue.c:1986 sp : ffff8000a6697af0 x29: ffff8000a6697af0 x28: 1fffe00019367a40 x27: dfff800000000000 x26: 0000000000000000 x25: ffff0000cc4463a8 x24: ffff0000d4cd3000 x23: 0000000000000000 x22: ffff0000cc446348 x21: 0000000000000008 x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: ffff80008a62bec8 x15: ffff600019888c69 x14: 1fffe00019888c69 x13: 00000000000000fb x12: ffffffffffffffff x11: 0000000000000001 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffff000127e7d340 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff80008022af04 x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000 Call trace: __queue_delayed_work kernel/workqueue.c:1939 [inline] queue_delayed_work_on+0x214/0x2e4 kernel/workqueue.c:1986 queue_delayed_work include/linux/workqueue.h:569 [inline] hci_conn_drop+0x198/0x2bc include/net/bluetooth/hci_core.h:1549 __sco_sock_close+0x3a8/0x7b0 net/bluetooth/sco.c:444 sco_sock_close net/bluetooth/sco.c:469 [inline] sco_sock_release+0xb4/0x2c0 net/bluetooth/sco.c:1246 __sock_release net/socket.c:659 [inline] sock_close+0xa4/0x1e8 net/socket.c:1402 __fput+0x324/0x7f8 fs/file_table.c:384 __fput_sync+0x60/0x9c fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __arm64_sys_close+0x150/0x1e0 fs/open.c:1557 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 irq event stamp: 9707 hardirqs last enabled at (9707): [] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline] hardirqs last enabled at (9707): [] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:94 hardirqs last disabled at (9706): [] __do_softirq+0x950/0xd54 kernel/softirq.c:569 softirqs last enabled at (9428): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (9428): [] lock_sock_nested+0xcc/0x11c net/core/sock.c:3512 softirqs last disabled at (9426): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (9426): [] lock_sock_nested+0x74/0x11c net/core/sock.c:3508 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ ODEBUG: activate not available (active state 0) object: 000000006c6fa4b5 object type: work_struct hint: hci_conn_timeout+0x0/0x46c net/bluetooth/hci_conn.c:928 WARNING: CPU: 1 PID: 10841 at lib/debugobjects.c:517 debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 Modules linked in: CPU: 1 PID: 10841 Comm: syz-executor.0 Tainted: G B W 6.6.0-rc4-syzkaller-g19af4a4ed414 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 lr : debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 sp : ffff8000a6697870 x29: ffff8000a6697870 x28: dfff800000000000 x27: ffff700014cd2f1c x26: ffff0000dbb0d4e8 x25: dfff800000000000 x24: ffff0000cc446348 x23: ffff80008ac76520 x22: ffff80008979b608 x21: ffff80008a7810a0 x20: 0000000000000000 x19: ffff80008ac75fc0 x18: 0000000000000000 x17: 0000000000000000 x16: ffff80008a62bec8 x15: 0000000000000001 x14: 1fffe0003683be32 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000002 x10: 0000000000000000 x9 : 1b0c71b94ecc0900 x8 : 1b0c71b94ecc0900 x7 : 545b5d3431353637 x6 : ffff800080366d18 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff8000805ad278 x2 : 0000000000000001 x1 : 0000000000000002 x0 : 0000000000000000 Call trace: debug_print_object+0x168/0x1e0 lib/debugobjects.c:514 debug_object_activate+0x600/0x7e0 lib/debugobjects.c:760 debug_work_activate kernel/workqueue.c:572 [inline] insert_work+0x4c/0x2d4 kernel/workqueue.c:1644 __queue_work+0xcf4/0x1338 kernel/workqueue.c:1799 __queue_delayed_work kernel/workqueue.c:1950 [inline] queue_delayed_work_on+0x1f4/0x2e4 kernel/workqueue.c:1986 queue_delayed_work include/linux/workqueue.h:569 [inline] hci_conn_drop+0x198/0x2bc include/net/bluetooth/hci_core.h:1549 __sco_sock_close+0x3a8/0x7b0 net/bluetooth/sco.c:444 sco_sock_close net/bluetooth/sco.c:469 [inline] sco_sock_release+0xb4/0x2c0 net/bluetooth/sco.c:1246 __sock_release net/socket.c:659 [inline] sock_close+0xa4/0x1e8 net/socket.c:1402 __fput+0x324/0x7f8 fs/file_table.c:384 __fput_sync+0x60/0x9c fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __arm64_sys_close+0x150/0x1e0 fs/open.c:1557 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 irq event stamp: 9707 hardirqs last enabled at (9707): [] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline] hardirqs last enabled at (9707): [] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:94 hardirqs last disabled at (9706): [] __do_softirq+0x950/0xd54 kernel/softirq.c:569 softirqs last enabled at (9428): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (9428): [] lock_sock_nested+0xcc/0x11c net/core/sock.c:3512 softirqs last disabled at (9426): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (9426): [] lock_sock_nested+0x74/0x11c net/core/sock.c:3508 ---[ end trace 0000000000000000 ]---