================================================================== BUG: KASAN: use-after-free in hci_uart_write_work+0x4ad/0x7b0 drivers/bluetooth/hci_ldisc.c:165 Read of size 8 at addr ffff88811036a228 by task kworker/1:7/1723 CPU: 1 PID: 1723 Comm: kworker/1:7 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Workqueue: events hci_uart_write_work Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x1e0 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:418 kasan_report+0x122/0x150 mm/kasan/report.c:522 __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 Allocated by task 523: 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:3421 [inline] kmem_cache_alloc_node+0x181/0x340 mm/slub.c:3468 __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 Freed by task 8967: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x31/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1771 slab_free mm/slub.c:3686 [inline] kmem_cache_free+0x12d/0x300 mm/slub.c:3711 kfree_skbmem+0x10c/0x180 net/core/skbuff.c:-1 __kfree_skb net/core/skbuff.c:874 [inline] kfree_skb_reason+0xdc/0x230 net/core/skbuff.c:896 kfree_skb include/linux/skbuff.h:1239 [inline] hci_uart_flush+0x90/0x3f0 drivers/bluetooth/hci_ldisc.c:235 hci_uart_close drivers/bluetooth/hci_ldisc.c:268 [inline] hci_uart_tty_close+0x7a/0x230 drivers/bluetooth/hci_ldisc.c:542 tty_ldisc_close drivers/tty/tty_ldisc.c:456 [inline] tty_ldisc_kill+0x10f/0x1f0 drivers/tty/tty_ldisc.c:608 tty_ldisc_hangup+0x409/0x520 drivers/tty/tty_ldisc.c:724 __tty_hangup+0x58b/0x7c0 drivers/tty/tty_io.c:631 tty_vhangup drivers/tty/tty_io.c:701 [inline] tty_ioctl+0x49a/0xc60 drivers/tty/tty_io.c:2716 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0x12f/0x1b0 fs/ioctl.c:856 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:856 x64_sys_call+0x58b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17 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 The buggy address belongs to the object at ffff88811036a140 which belongs to the cache skbuff_head_cache of size 256 The buggy address is located 232 bytes inside of 256-byte region [ffff88811036a140, ffff88811036a240) The buggy address belongs to the physical page: page:ffffea000440da80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11036a flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea0005628c00 dead000000000008 ffff8881002b1680 raw: 0000000000000000 00000000800c000c 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 7651, tgid 7650 (syz.0.2319), ts 364222858872, free_ts 363085871918 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:1962 [inline] new_slab+0x98/0x3d0 mm/slub.c:2015 ___slab_alloc+0x6f6/0xb50 mm/slub.c:3203 kmem_cache_alloc_bulk+0x16a/0x3c0 mm/slub.c:3858 xdp_recv_frames net/bpf/test_run.c:237 [inline] xdp_test_run_batch net/bpf/test_run.c:334 [inline] bpf_test_run_xdp_live+0x1545/0x19e0 net/bpf/test_run.c:362 bpf_prog_test_run_xdp+0x6f1/0xe50 net/bpf/test_run.c:1390 bpf_prog_test_run+0x3e3/0x630 kernel/bpf/syscall.c:3665 __sys_bpf+0x56d/0x780 kernel/bpf/syscall.c:5020 __do_sys_bpf kernel/bpf/syscall.c:5106 [inline] __se_sys_bpf kernel/bpf/syscall.c:5104 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5104 x64_sys_call+0x488/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 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 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 bpf_ringbuf_free kernel/bpf/ringbuf.c:229 [inline] ringbuf_map_free+0xb6/0x110 kernel/bpf/ringbuf.c:238 bpf_map_free_deferred+0x105/0x1c0 kernel/bpf/syscall.c:637 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 Memory state around the buggy address: ffff88811036a100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88811036a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811036a200: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88811036a280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811036a300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================