================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1486 Read of size 2 at addr ffff88801cbf5808 by task kworker/0:2/3647 CPU: 0 PID: 3647 Comm: kworker/0:2 Not tainted 6.0.0-rc2-next-20220824-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 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/0x719 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 3659: 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+0xa9/0xd0 mm/kasan/common.c:525 kasan_kmalloc include/linux/kasan.h:234 [inline] __do_kmalloc_node mm/slab_common.c:930 [inline] __kmalloc_node_track_caller+0x55/0xc0 mm/slab_common.c:950 kmalloc_reserve net/core/skbuff.c:358 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:430 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:3160 hci_init_stage_sync net/bluetooth/hci_sync.c:3071 [inline] hci_init1_sync net/bluetooth/hci_sync.c:3254 [inline] hci_init_sync net/bluetooth/hci_sync.c:4329 [inline] hci_dev_init_sync net/bluetooth/hci_sync.c:4517 [inline] hci_dev_open_sync+0x177b/0x2190 net/bluetooth/hci_sync.c:4597 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 3659: 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+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1740 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1766 slab_free mm/slub.c:3497 [inline] __kmem_cache_free+0xab/0x3b0 mm/slub.c:3510 skb_free_head+0xac/0x110 net/core/skbuff.c:658 skb_release_data+0x5f1/0x870 net/core/skbuff.c:687 skb_release_all net/core/skbuff.c:752 [inline] __kfree_skb net/core/skbuff.c:766 [inline] kfree_skb_reason.part.0+0xdd/0x320 net/core/skbuff.c:788 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:4631 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 ffff88801cbf5800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88801cbf5800, ffff88801cbf5a00) The buggy address belongs to the physical page: page:ffffea000072fd00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1cbf4 head:ffffea000072fd00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001e21d00 dead000000000002 ffff888011841c80 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 639, tgid 639 (kworker/u4:3), ts 7496750158, free_ts 0 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5507 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1810 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1955 new_slab mm/slub.c:2015 [inline] ___slab_alloc+0xa3e/0x11d0 mm/slub.c:3017 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3104 slab_alloc_node mm/slub.c:3195 [inline] __kmem_cache_alloc_node+0x18a/0x3d0 mm/slub.c:3268 kmalloc_trace+0x22/0x60 mm/slab_common.c:1010 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:695 [inline] alloc_bprm+0x51/0x900 fs/exec.c:1516 kernel_execve+0xab/0x500 fs/exec.c:1975 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page_owner free stack trace missing Memory state around the buggy address: ffff88801cbf5700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801cbf5780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801cbf5800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801cbf5880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801cbf5900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================