================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1486 Read of size 2 at addr ffff88801ea71c08 by task kworker/2:5/5534 CPU: 2 PID: 5534 Comm: kworker/2:5 Not tainted 6.0.0-rc7-syzkaller-00162-g5a77386984b5 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: events hci_cmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1486 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3729: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:525 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:434 alloc_skb include/linux/skbuff.h:1257 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:469 [inline] hci_cmd_sync_alloc net/bluetooth/hci_sync.c:54 [inline] hci_cmd_sync_add net/bluetooth/hci_sync.c:95 [inline] __hci_cmd_sync_sk+0x568/0xe20 net/bluetooth/hci_sync.c:157 __hci_cmd_sync_status_sk net/bluetooth/hci_sync.c:246 [inline] __hci_cmd_sync_status net/bluetooth/hci_sync.c:271 [inline] hci_read_local_features_sync+0xca/0x1e0 net/bluetooth/hci_sync.c:2906 hci_init_stage_sync net/bluetooth/hci_sync.c:2817 [inline] hci_init1_sync net/bluetooth/hci_sync.c:3000 [inline] hci_init_sync net/bluetooth/hci_sync.c:4075 [inline] hci_dev_init_sync net/bluetooth/hci_sync.c:4263 [inline] hci_dev_open_sync+0x177b/0x2190 net/bluetooth/hci_sync.c:4343 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xda/0x620 net/bluetooth/hci_core.c:975 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 3729: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x13d/0x1a0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3418 [inline] kfree+0x173/0x390 mm/slab.c:3786 skb_free_head+0xac/0x110 net/core/skbuff.c:662 skb_release_data+0x5f1/0x870 net/core/skbuff.c:691 skb_release_all net/core/skbuff.c:756 [inline] __kfree_skb net/core/skbuff.c:770 [inline] kfree_skb_reason.part.0+0xdd/0x320 net/core/skbuff.c:792 kfree_skb_reason+0x85/0x110 include/linux/refcount.h:279 kfree_skb include/linux/skbuff.h:1206 [inline] hci_dev_open_sync+0xbe2/0x2190 net/bluetooth/hci_sync.c:4377 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xda/0x620 net/bluetooth/hci_core.c:975 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88801ea71c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88801ea71c00, ffff88801ea71e00) The buggy address belongs to the physical page: page:ffffea00007a9c40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ea71 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00007dc8c8 ffffea0000789d88 ffff888011840600 raw: 0000000000000000 ffff88801ea71000 0000000100000004 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 0x2c2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3729, tgid 3729 (kworker/u19:8), ts 250512905098, free_ts 193514814254 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages_slowpath.constprop.0+0x34d/0x2300 mm/page_alloc.c:5084 __alloc_pages+0x43d/0x510 mm/page_alloc.c:5562 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] slab_alloc_node mm/slab.c:3220 [inline] kmem_cache_alloc_node_trace+0x50a/0x570 mm/slab.c:3601 __do_kmalloc_node mm/slab.c:3623 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3638 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:434 alloc_skb include/linux/skbuff.h:1257 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:469 [inline] hci_cmd_sync_alloc net/bluetooth/hci_sync.c:54 [inline] hci_cmd_sync_add net/bluetooth/hci_sync.c:95 [inline] __hci_cmd_sync_sk+0x568/0xe20 net/bluetooth/hci_sync.c:157 __hci_cmd_sync_status_sk net/bluetooth/hci_sync.c:246 [inline] __hci_cmd_sync_status net/bluetooth/hci_sync.c:271 [inline] hci_read_local_features_sync+0xca/0x1e0 net/bluetooth/hci_sync.c:2906 hci_init_stage_sync net/bluetooth/hci_sync.c:2817 [inline] hci_init1_sync net/bluetooth/hci_sync.c:3000 [inline] hci_init_sync net/bluetooth/hci_sync.c:4075 [inline] hci_dev_init_sync net/bluetooth/hci_sync.c:4263 [inline] hci_dev_open_sync+0x177b/0x2190 net/bluetooth/hci_sync.c:4343 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xda/0x620 net/bluetooth/hci_core.c:975 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 slab_destroy mm/slab.c:1615 [inline] drain_freelist.isra.0+0xc6/0x130 mm/slab.c:2207 cache_reap+0x1b9/0x2e0 mm/slab.c:4017 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff88801ea71b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801ea71b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801ea71c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801ea71c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801ea71d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================