Bluetooth: hci5: command 0x1003 tx timeout ================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x1d3/0x1f0 net/bluetooth/hci_core.c:1473 Read of size 8 at addr ffff88806f7f80c8 by task kworker/1:6/4052 CPU: 1 PID: 4052 Comm: kworker/1:6 Not tainted 5.15.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events hci_cmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 hci_cmd_timeout+0x1d3/0x1f0 net/bluetooth/hci_core.c:1473 process_one_work+0x85b/0x1430 kernel/workqueue.c:2297 worker_thread+0x598/0x1040 kernel/workqueue.c:2444 kthread+0x38b/0x460 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 3571: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x83/0xb0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3214 [inline] kmem_cache_alloc+0x209/0x390 mm/slub.c:3219 skb_clone+0x125/0x300 net/core/skbuff.c:1519 hci_cmd_work+0x15f/0x340 net/bluetooth/hci_core.c:3926 process_one_work+0x85b/0x1430 kernel/workqueue.c:2297 worker_thread+0x598/0x1040 kernel/workqueue.c:2444 kthread+0x38b/0x460 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 150: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook+0x81/0x190 mm/slub.c:1725 slab_free mm/slub.c:3483 [inline] kmem_cache_free+0x8a/0x5b0 mm/slub.c:3499 hci_dev_open_sync+0x7e4/0x1a40 net/bluetooth/hci_sync.c:3896 hci_dev_do_open+0x23/0x60 net/bluetooth/hci_core.c:482 hci_power_on+0xf6/0x4c0 net/bluetooth/hci_core.c:963 process_one_work+0x85b/0x1430 kernel/workqueue.c:2297 worker_thread+0x598/0x1040 kernel/workqueue.c:2444 kthread+0x38b/0x460 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88806f7f8000 which belongs to the cache skbuff_head_cache of size 224 The buggy address is located 200 bytes inside of 224-byte region [ffff88806f7f8000, ffff88806f7f80e0) The buggy address belongs to the page: page:ffffea0001bdfe00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6f7f8 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001ede3c0 0000000500000005 ffff888014fad280 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 7, ts 476077417533, free_ts 476004872776 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa6f/0x2f50 mm/page_alloc.c:4153 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375 alloc_slab_page mm/slub.c:1763 [inline] allocate_slab mm/slub.c:1900 [inline] new_slab+0x319/0x490 mm/slub.c:1963 ___slab_alloc+0x923/0xfe0 mm/slub.c:2994 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3081 slab_alloc_node mm/slub.c:3172 [inline] kmem_cache_alloc_node+0x11f/0x3d0 mm/slub.c:3242 __alloc_skb+0x157/0x280 net/core/skbuff.c:412 alloc_skb include/linux/skbuff.h:1116 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:664 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:721 [inline] nsim_dev_trap_report_work+0x275/0xb50 drivers/net/netdevsim/dev.c:762 process_one_work+0x85b/0x1430 kernel/workqueue.c:2297 worker_thread+0x598/0x1040 kernel/workqueue.c:2444 kthread+0x38b/0x460 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3431 release_pages+0xc6b/0x1670 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu mm/mmu_gather.c:249 [inline] tlb_finish_mmu+0x127/0x790 mm/mmu_gather.c:340 exit_mmap+0x1b7/0x540 mm/mmap.c:3173 __mmput+0xed/0x430 kernel/fork.c:1115 exit_mm kernel/exit.c:501 [inline] do_exit+0x940/0x24b0 kernel/exit.c:812 do_group_exit+0xe7/0x290 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x35/0x40 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88806f7f7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806f7f8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806f7f8080: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88806f7f8100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88806f7f8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================