syzbot


KASAN: use-after-free Read in hci_uart_write_work

Status: premoderation: reported on 2025/09/08 09:39
Reported-by: syzbot+70b97140585f0f33112e@syzkaller.appspotmail.com
First crash: 20d, last: 8h53m
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in hci_uart_write_work 19 1 2d09h 2d09h 0/2 premoderation: reported on 2025/09/26 00:52
android-6-12 KASAN: slab-use-after-free Read in hci_uart_write_work 19 1 17d 17d 0/1 premoderation: reported on 2025/09/11 04:00
upstream KASAN: slab-use-after-free Read in hci_uart_write_work bluetooth 19 syz 4 4d07h 75d 0/29 upstream: reported syz repro on 2025/07/14 17:09

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in hci_uart_write_work+0x4ad/0x7b0 drivers/bluetooth/hci_ldisc.c:165
Read of size 8 at addr ffff888109e9c4a8 by task kworker/0:8/1425

CPU: 0 PID: 1425 Comm: kworker/0:8 Tainted: G        W          syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Workqueue: events hci_uart_write_work
Call Trace:
 <TASK>
 __dump_stack+0x21/0x24 lib/dump_stack.c:88
 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106
 print_address_description+0x71/0x200 mm/kasan/report.c:316
 print_report+0x4a/0x60 mm/kasan/report.c:420
 kasan_report+0x122/0x150 mm/kasan/report.c:524
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:351
 hci_uart_write_work+0x4ad/0x7b0 drivers/bluetooth/hci_ldisc.c:165
 process_one_work+0x71f/0xc40 kernel/workqueue.c:2302
 worker_thread+0xa29/0x11f0 kernel/workqueue.c:2449
 kthread+0x281/0x320 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 547:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505
 __kasan_slab_alloc+0x72/0x80 mm/kasan/common.c:333
 kasan_slab_alloc include/linux/kasan.h:202 [inline]
 slab_post_alloc_hook+0x4f/0x2d0 mm/slab.h:768
 slab_alloc_node mm/slub.c:3382 [inline]
 kmem_cache_alloc_node+0x181/0x340 mm/slub.c:3429
 __alloc_skb+0xea/0x4b0 net/core/skbuff.c:508
 alloc_skb include/linux/skbuff.h:1290 [inline]
 bt_skb_alloc include/net/bluetooth/bluetooth.h:473 [inline]
 hci_cmd_sync_alloc net/bluetooth/hci_sync.c:55 [inline]
 hci_cmd_sync_add net/bluetooth/hci_sync.c:96 [inline]
 __hci_cmd_sync_sk+0x1d1/0xcf0 net/bluetooth/hci_sync.c:158
 __hci_cmd_sync_status_sk net/bluetooth/hci_sync.c:253 [inline]
 __hci_cmd_sync_status net/bluetooth/hci_sync.c:277 [inline]
 hci_read_local_features_sync net/bluetooth/hci_sync.c:3621 [inline]
 hci_init_stage_sync net/bluetooth/hci_sync.c:3532 [inline]
 hci_init1_sync net/bluetooth/hci_sync.c:3716 [inline]
 hci_init_sync net/bluetooth/hci_sync.c:4798 [inline]
 hci_dev_init_sync net/bluetooth/hci_sync.c:4989 [inline]
 hci_dev_open_sync+0x13a7/0x3260 net/bluetooth/hci_sync.c:5069
 hci_dev_do_open net/bluetooth/hci_core.c:439 [inline]
 hci_power_on+0x195/0x5c0 net/bluetooth/hci_core.c:945
 process_one_work+0x71f/0xc40 kernel/workqueue.c:2302
 worker_thread+0xa29/0x11f0 kernel/workqueue.c:2449
 kthread+0x281/0x320 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888109e9c3c0
 which belongs to the cache skbuff_head_cache of size 256
The buggy address is located 232 bytes inside of
 256-byte region [ffff888109e9c3c0, ffff888109e9c4c0)

The buggy address belongs to the physical page:
page:ffffea000427a700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109e9c
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004b323c0 dead000000000004 ffff8881002b1200
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 11686, tgid 11686 (syz-executor), ts 1166359566115, free_ts 1166359283758
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2643
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2650
 get_page_from_freelist+0x2c7b/0x2cf0 mm/page_alloc.c:4554
 __alloc_pages+0x1c3/0x450 mm/page_alloc.c:5868
 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
 allocate_slab mm/slub.c:1967 [inline]
 new_slab+0x98/0x3d0 mm/slub.c:2020
 ___slab_alloc+0x6bd/0xb20 mm/slub.c:3177
 __slab_alloc+0x5e/0xa0 mm/slub.c:3263
 slab_alloc_node mm/slub.c:3348 [inline]
 slab_alloc mm/slub.c:3392 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3399 [inline]
 kmem_cache_alloc+0x1b0/0x330 mm/slub.c:3408
 skb_clone+0x1f5/0x380 net/core/skbuff.c:1663
 dev_queue_xmit_nit+0x1a5/0xab0 net/core/dev.c:2329
 xmit_one net/core/dev.c:3674 [inline]
 dev_hard_start_xmit+0x16a/0x750 net/core/dev.c:3697
 sch_direct_xmit+0x267/0x8d0 net/sched/sch_generic.c:342
 __dev_xmit_skb net/core/dev.c:3918 [inline]
 __dev_queue_xmit+0x15f9/0x3420 net/core/dev.c:4323
 dev_queue_xmit include/linux/netdevice.h:3085 [inline]
 neigh_hh_output include/net/neighbour.h:536 [inline]
 neigh_output include/net/neighbour.h:550 [inline]
 ip_finish_output2+0xb09/0xef0 net/ipv4/ip_output.c:228
 __ip_finish_output+0x172/0x370 net/ipv4/ip_output.c:-1
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1551 [inline]
 free_pcp_prepare mm/page_alloc.c:1625 [inline]
 free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3589
 free_unref_page+0x8f/0x530 mm/page_alloc.c:3687
 free_the_page mm/page_alloc.c:836 [inline]
 __free_pages+0x67/0x100 mm/page_alloc.c:5957
 free_pages+0x82/0x90 mm/page_alloc.c:5968
 selinux_genfs_get_sid+0x20b/0x250 security/selinux/hooks.c:1309
 inode_doinit_with_dentry+0x86e/0xd70 security/selinux/hooks.c:1504
 selinux_d_instantiate+0x27/0x40 security/selinux/hooks.c:6396
 security_d_instantiate+0xb3/0x110 security/security.c:2096
 d_splice_alias+0x6d/0x390 fs/dcache.c:3153
 kernfs_iop_lookup+0x2c2/0x310 fs/kernfs/dir.c:1204
 __lookup_slow+0x2c7/0x3f0 fs/namei.c:1689
 lookup_slow+0x57/0x70 fs/namei.c:1706
 walk_component+0x2f4/0x420 fs/namei.c:1997
 lookup_last fs/namei.c:2454 [inline]
 path_lookupat+0x180/0x490 fs/namei.c:2478
 filename_lookup+0x1f0/0x500 fs/namei.c:2507
 user_path_at_empty+0x47/0x1c0 fs/namei.c:2904

Memory state around the buggy address:
 ffff888109e9c380: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
 ffff888109e9c400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888109e9c480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                                  ^
 ffff888109e9c500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888109e9c580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/28 01:39 android14-6.1 5303560ee8cf 001c9061 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in hci_uart_write_work
2025/09/27 18:04 android14-6.1 5303560ee8cf 001c9061 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in hci_uart_write_work
2025/09/27 17:54 android14-6.1 5303560ee8cf 001c9061 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in hci_uart_write_work
2025/09/27 17:54 android14-6.1 5303560ee8cf 001c9061 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in hci_uart_write_work
2025/09/22 06:59 android14-6.1 462bdb2cb1b1 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in hci_uart_write_work
2025/09/21 04:26 android14-6.1 462bdb2cb1b1 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in hci_uart_write_work
2025/09/08 09:38 android14-6.1 499d2a0ffd4f d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in hci_uart_write_work
* Struck through repros no longer work on HEAD.