[v5.15] KASAN: use-after-free Read in hci_ncmd_timeout (2)

0 views
Skip to first unread message

syzbot

unread,
Jan 25, 2026, 11:50:33 PM (2 days ago) Jan 25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9eec9a14ee10 Linux 5.15.198
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17dda452580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=9e2a46ca998709bbc728
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7146a7b4242e/disk-9eec9a14.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a11468b96c22/vmlinux-9eec9a14.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e7cb8f058e1c/bzImage-9eec9a14.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+9e2a46...@syzkaller.appspotmail.com

Bluetooth: hci1: Controller not accepting commands anymore: ncmd = 0
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: use-after-free in test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
BUG: KASAN: use-after-free in hci_ncmd_timeout+0x7a/0x200 net/bluetooth/hci_core.c:2802
Read of size 8 at addr ffff88802a3680a8 by task kworker/1:8/5061

CPU: 1 PID: 5061 Comm: kworker/1:8 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: events hci_ncmd_timeout
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x235/0x290 mm/kasan/generic.c:189
instrument_atomic_read include/linux/instrumented.h:71 [inline]
test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
hci_ncmd_timeout+0x7a/0x200 net/bluetooth/hci_core.c:2802
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>

Allocated by task 4186:
kasan_save_stack mm/kasan/common.c:38 [inline]
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+0xb5/0xf0 mm/kasan/common.c:522
kmalloc include/linux/slab.h:612 [inline]
kzalloc include/linux/slab.h:738 [inline]
hci_alloc_dev_priv+0x23/0x1d20 net/bluetooth/hci_core.c:3775
hci_alloc_dev include/net/bluetooth/hci_core.h:1242 [inline]
__vhci_create_device drivers/bluetooth/hci_vhci.c:102 [inline]
vhci_create_device+0x122/0x5c0 drivers/bluetooth/hci_vhci.c:153
vhci_get_user drivers/bluetooth/hci_vhci.c:210 [inline]
vhci_write+0x391/0x450 drivers/bluetooth/hci_vhci.c:290
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 4186:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
hci_release_dev+0x138e/0x1500 net/bluetooth/hci_core.c:4096
bt_host_release+0x7e/0x90 net/bluetooth/hci_sysfs.c:85
device_release+0x92/0x1c0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:713 [inline]
kobject_release lib/kobject.c:744 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x21d/0x460 lib/kobject.c:761
vhci_release+0x7b/0xc0 drivers/bluetooth/hci_vhci.c:346
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0x626/0x20c0 kernel/exit.c:883
do_group_exit+0x12e/0x300 kernel/exit.c:997
__do_sys_exit_group kernel/exit.c:1008 [inline]
__se_sys_exit_group kernel/exit.c:1006 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1006
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3d0 kernel/workqueue.c:1366
__queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
call_timer_fn+0x17b/0x540 kernel/time/timer.c:1451
expire_timers kernel/time/timer.c:1491 [inline]
__run_timers+0x565/0x7f0 kernel/time/timer.c:1767
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1780
handle_softirqs+0x339/0x830 kernel/softirq.c:576
__do_softirq kernel/softirq.c:610 [inline]
invoke_softirq kernel/softirq.c:450 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:659
irq_exit_rcu+0x5/0x20 kernel/softirq.c:671
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676

Second to last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3d0 kernel/workqueue.c:1366
__queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
queue_work_on+0x124/0x1f0 kernel/workqueue.c:1559
queue_work include/linux/workqueue.h:512 [inline]
hci_recv_frame+0x18c/0x1f0 net/bluetooth/hci_core.c:4160
vhci_get_user drivers/bluetooth/hci_vhci.c:194 [inline]
vhci_write+0x33f/0x450 drivers/bluetooth/hci_vhci.c:290
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88802a368000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 168 bytes inside of
8192-byte region [ffff88802a368000, ffff88802a36a000)
The buggy address belongs to the page:
page:ffffea0000a8da00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a368
head:ffffea0000a8da00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888016c42280
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4186, ts 60148790534, free_ts 59938218273
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1bbd/0x1ca0 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5487
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x80a/0xdd0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
slab_alloc mm/slub.c:3233 [inline]
__kmalloc+0x1cd/0x330 mm/slub.c:4408
kmalloc include/linux/slab.h:612 [inline]
kzalloc include/linux/slab.h:738 [inline]
hci_alloc_dev_priv+0x23/0x1d20 net/bluetooth/hci_core.c:3775
hci_alloc_dev include/net/bluetooth/hci_core.h:1242 [inline]
__vhci_create_device drivers/bluetooth/hci_vhci.c:102 [inline]
vhci_create_device+0x122/0x5c0 drivers/bluetooth/hci_vhci.c:153
vhci_get_user drivers/bluetooth/hci_vhci.c:210 [inline]
vhci_write+0x391/0x450 drivers/bluetooth/hci_vhci.c:290
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
put_page include/linux/mm.h:1258 [inline]
__skb_frag_unref include/linux/skbuff.h:3254 [inline]
skb_release_data+0x3b1/0x800 net/core/skbuff.c:672
skb_release_all net/core/skbuff.c:742 [inline]
__kfree_skb+0x4c/0x60 net/core/skbuff.c:756
sk_eat_skb include/net/sock.h:2792 [inline]
tcp_recvmsg_locked+0x14e1/0x27f0 net/ipv4/tcp.c:2517
tcp_recvmsg+0x232/0x770 net/ipv4/tcp.c:2563
inet_recvmsg+0x146/0x200 net/ipv4/af_inet.c:868
sock_recvmsg_nosec net/socket.c:968 [inline]
sock_recvmsg net/socket.c:986 [inline]
sock_read_iter+0x2b8/0x380 net/socket.c:1067
call_read_iter include/linux/fs.h:2167 [inline]
new_sync_read fs/read_write.c:404 [inline]
vfs_read+0x759/0xd60 fs/read_write.c:485
ksys_read+0x152/0x260 fs/read_write.c:623
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
ffff88802a367f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802a368000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802a368080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88802a368100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88802a368180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages