[v6.1] KASAN: use-after-free Write in hci_conn_hash_flush (2)

3 views
Skip to first unread message

syzbot

unread,
Oct 22, 2025, 3:01:31 PM (6 days ago) Oct 22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8e6e2188d949 Linux 6.1.157
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=162ad3e2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=7eb38bd5021fec61
dashboard link: https://syzkaller.appspot.com/bug?extid=f0a5fc97ed915e4cdab3
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/dcc01324de1b/disk-8e6e2188.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a93dd5469c70/vmlinux-8e6e2188.xz
kernel image: https://storage.googleapis.com/syzbot-assets/04635e384401/bzImage-8e6e2188.xz

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

==================================================================
BUG: KASAN: use-after-free in hci_conn_unlink net/bluetooth/hci_conn.c:1085 [inline]
BUG: KASAN: use-after-free in hci_conn_hash_flush+0x1d1/0x290 net/bluetooth/hci_conn.c:2510
Write of size 8 at addr ffff88804d034ab0 by task syz-executor/9647

CPU: 0 PID: 9647 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
hci_conn_unlink net/bluetooth/hci_conn.c:1085 [inline]
hci_conn_hash_flush+0x1d1/0x290 net/bluetooth/hci_conn.c:2510
hci_dev_close_sync+0x930/0xf40 net/bluetooth/hci_sync.c:5241
hci_dev_do_close net/bluetooth/hci_core.c:510 [inline]
hci_unregister_dev+0x202/0x4f0 net/bluetooth/hci_core.c:2705
vhci_release+0x7f/0xd0 drivers/bluetooth/hci_vhci.c:573
__fput+0x22c/0x920 fs/file_table.c:320
task_work_run+0x1ca/0x250 kernel/task_work.c:203
exit_task_work include/linux/task_work.h:39 [inline]
do_exit+0x93e/0x2400 kernel/exit.c:880
do_group_exit+0x217/0x2d0 kernel/exit.c:1022
get_signal+0x1272/0x1350 kernel/signal.c:2871
arch_do_signal_or_restart+0xb7/0x1240 arch/x86/kernel/signal.c:871
exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7facf19c1885
Code: Unable to access opcode bytes at 0x7facf19c185b.
RSP: 002b:00007fffe0e4d020 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6
RAX: 0000000000000000 RBX: 00000000000003c5 RCX: 00007facf19c1885
RDX: 00007fffe0e4d060 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fffe0e4d0cc R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000001388
R13: 00000000000927c0 R14: 000000000007aa4e R15: 00007fffe0e4d120
</TASK>

Allocated by task 12129:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
hci_conn_add+0xb7/0x1390 net/bluetooth/hci_conn.c:990
hci_connect_sco+0x86/0x330 net/bluetooth/hci_conn.c:1630
sco_connect net/bluetooth/sco.c:280 [inline]
sco_sock_connect+0x2d0/0x970 net/bluetooth/sco.c:616
__sys_connect_file net/socket.c:2011 [inline]
__sys_connect+0x389/0x410 net/socket.c:2028
__do_sys_connect net/socket.c:2038 [inline]
__se_sys_connect net/socket.c:2035 [inline]
__x64_sys_connect+0x76/0x80 net/socket.c:2035
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 9647:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3700
device_release+0x92/0x1c0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:681 [inline]
kobject_release lib/kobject.c:712 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x21d/0x460 lib/kobject.c:729
hci_conn_cleanup+0x575/0x730 net/bluetooth/hci_conn.c:172
hci_conn_del+0x515/0x720 net/bluetooth/hci_conn.c:1152
hci_conn_hash_flush+0x203/0x290 net/bluetooth/hci_conn.c:2511
hci_dev_close_sync+0x930/0xf40 net/bluetooth/hci_sync.c:5241
hci_dev_do_close net/bluetooth/hci_core.c:510 [inline]
hci_unregister_dev+0x202/0x4f0 net/bluetooth/hci_core.c:2705
vhci_release+0x7f/0xd0 drivers/bluetooth/hci_vhci.c:573
__fput+0x22c/0x920 fs/file_table.c:320
task_work_run+0x1ca/0x250 kernel/task_work.c:203
exit_task_work include/linux/task_work.h:39 [inline]
do_exit+0x93e/0x2400 kernel/exit.c:880
do_group_exit+0x217/0x2d0 kernel/exit.c:1022
get_signal+0x1272/0x1350 kernel/signal.c:2871
arch_do_signal_or_restart+0xb7/0x1240 arch/x86/kernel/signal.c:871
exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87
entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88804d034000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 2736 bytes inside of
4096-byte region [ffff88804d034000, ffff88804d035000)

The buggy address belongs to the physical page:
page:ffffea0001340c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4d030
head:ffffea0001340c00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017442140
raw: 0000000000000000 0000000000040004 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 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3638, tgid 3638 (udevd), ts 175015197479, free_ts 174980245056
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
__alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
alloc_slab_page+0x5d/0x160 mm/slub.c:1799
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1997
___slab_alloc+0xbc6/0x1230 mm/slub.c:3154
__slab_alloc mm/slub.c:3240 [inline]
slab_alloc_node mm/slub.c:3325 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc+0xa0/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
tomoyo_realpath_from_path+0xdf/0x5d0 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x1aa/0x380 security/tomoyo/file.c:771
security_file_open+0x5e/0xa0 security/security.c:1681
do_dentry_open+0x305/0x10d0 fs/open.c:869
do_open fs/namei.c:3634 [inline]
path_openat+0x25c6/0x2e70 fs/namei.c:3791
do_filp_open+0x1c1/0x3c0 fs/namei.c:3818
do_sys_openat2+0x142/0x490 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1345
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
free_slab mm/slub.c:2036 [inline]
discard_slab mm/slub.c:2042 [inline]
__unfreeze_partials+0x1a5/0x200 mm/slub.c:2591
put_cpu_partial+0x17c/0x250 mm/slub.c:2667
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3359 [inline]
slab_alloc mm/slub.c:3367 [inline]
__kmem_cache_alloc_lru mm/slub.c:3374 [inline]
kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3383
ptlock_alloc+0x1c/0x60 mm/memory.c:6047
ptlock_init include/linux/mm.h:2480 [inline]
pgtable_pte_page_ctor include/linux/mm.h:2507 [inline]
__pte_alloc_one include/asm-generic/pgalloc.h:66 [inline]
pte_alloc_one+0xc5/0x2f0 arch/x86/mm/pgtable.c:33
__pte_alloc+0x21/0x150 mm/memory.c:468
copy_pte_range mm/memory.c:1042 [inline]
copy_pmd_range mm/memory.c:1177 [inline]
copy_pud_range mm/memory.c:1214 [inline]
copy_p4d_range mm/memory.c:1238 [inline]
copy_page_range+0x32c2/0x39e0 mm/memory.c:1336
dup_mmap kernel/fork.c:697 [inline]
dup_mm kernel/fork.c:1541 [inline]
copy_mm+0xde3/0x15c0 kernel/fork.c:1590
copy_process+0x1953/0x4020 kernel/fork.c:2351
kernel_clone+0x225/0x8b0 kernel/fork.c:2757

Memory state around the buggy address:
ffff88804d034980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88804d034a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88804d034a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88804d034b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88804d034b80: 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