Bluetooth: hci13: command 0x1003 tx timeout ================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x239/0x250 net/bluetooth/hci_core.c:1494 Read of size 8 at addr ffff88807b540858 by task kworker/u5:1/19563 CPU: 1 PID: 19563 Comm: kworker/u5:1 Not tainted 6.0.0-rc6-next-20220923-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: hci14 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:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 hci_cmd_timeout+0x239/0x250 net/bluetooth/hci_core.c:1494 process_one_work+0x9bf/0x1710 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 19563: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7e/0x80 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:754 [inline] slab_alloc_node mm/slub.c:3336 [inline] slab_alloc mm/slub.c:3344 [inline] __kmem_cache_alloc_lru mm/slub.c:3351 [inline] kmem_cache_alloc+0x2b7/0x3d0 mm/slub.c:3360 skb_clone+0x16e/0x3c0 net/core/skbuff.c:1548 hci_cmd_work+0x191/0x570 net/bluetooth/hci_core.c:4064 process_one_work+0x9bf/0x1710 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 ffff88807b540780 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 216 bytes inside of 240-byte region [ffff88807b540780, ffff88807b540870) The buggy address belongs to the physical page: page:ffffea0001ed5000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xdead000000000100 pfn:0x7b540 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888144a14500 dead0000000c000c 0000000000000000 raw: dead000000000100 dead000000000122 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 0x112820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 21959, tgid 21942 (syz-executor.4), ts 1272345649179, free_ts 1272340447306 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x1092/0x2d20 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5546 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1739 [inline] allocate_slab+0x213/0x300 mm/slub.c:1884 new_slab mm/slub.c:1937 [inline] ___slab_alloc+0xac1/0x1430 mm/slub.c:3119 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3217 slab_alloc_node mm/slub.c:3302 [inline] slab_alloc mm/slub.c:3344 [inline] __kmem_cache_alloc_lru mm/slub.c:3351 [inline] kmem_cache_alloc+0x31c/0x3d0 mm/slub.c:3360 skb_clone+0x16e/0x3c0 net/core/skbuff.c:1548 pfkey_broadcast_one+0xb0/0x360 net/key/af_key.c:199 pfkey_broadcast+0x2d8/0x650 net/key/af_key.c:254 pfkey_send_acquire+0xe8c/0x2520 net/key/af_key.c:3246 km_query+0xac/0x220 net/xfrm/xfrm_state.c:2248 xfrm_state_find+0x2bfe/0x4f10 net/xfrm/xfrm_state.c:1165 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2392 [inline] xfrm_tmpl_resolve+0x2f3/0xd40 net/xfrm/xfrm_policy.c:2437 xfrm_resolve_and_create_bundle+0x123/0x2580 net/xfrm/xfrm_policy.c:2730 xfrm_lookup_with_ifid+0x229/0x20f0 net/xfrm/xfrm_policy.c:3064 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page_list+0x172/0xc40 mm/page_alloc.c:3528 release_pages+0xc8c/0x1360 mm/swap.c:1055 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:58 tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu mm/mmu_gather.c:262 [inline] tlb_finish_mmu+0x147/0x7e0 mm/mmu_gather.c:353 exit_mmap+0x1fe/0x7a0 mm/mmap.c:3101 __mmput+0x128/0x4c0 kernel/fork.c:1188 mmput+0x5c/0x70 kernel/fork.c:1210 exit_mm kernel/exit.c:516 [inline] do_exit+0xa39/0x2a20 kernel/exit.c:807 do_group_exit+0xd0/0x2a0 kernel/exit.c:950 get_signal+0x21a6/0x2430 kernel/signal.c:2858 arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:296 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88807b540700: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff88807b540780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807b540800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ^ ffff88807b540880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88807b540900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================