================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x1c3/0x1f0 net/bluetooth/hci_core.c:1486 Read of size 2 at addr ffff88806f397808 by task kworker/1:5/4117 CPU: 1 PID: 4117 Comm: kworker/1:5 Not tainted 6.0.0-rc7-syzkaller-00239-gb357fd1c2afc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: events hci_cmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x220 mm/kasan/report.c:433 kasan_report+0xfb/0x130 mm/kasan/report.c:495 hci_cmd_timeout+0x1c3/0x1f0 net/bluetooth/hci_core.c:1486 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 4088: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:234 [inline] __kmalloc_node_track_caller+0x265/0x400 mm/slub.c:4969 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0x11d/0x620 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+0x39/0x340 net/bluetooth/hci_sync.c:54 hci_cmd_sync_add+0xaa/0x240 net/bluetooth/hci_sync.c:95 __hci_cmd_sync_sk+0xdf/0x680 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 net/bluetooth/hci_sync.c:2906 [inline] hci_init_stage_sync net/bluetooth/hci_sync.c:2817 [inline] hci_init1_sync+0x1d6/0x6d0 net/bluetooth/hci_sync.c:3000 hci_init_sync net/bluetooth/hci_sync.c:4075 [inline] hci_dev_init_sync+0x24a/0x6b0 net/bluetooth/hci_sync.c:4263 hci_dev_open_sync+0x34e/0x8d0 net/bluetooth/hci_sync.c:4343 hci_dev_do_open net/bluetooth/hci_core.c:483 [inline] hci_power_on+0x16a/0x610 net/bluetooth/hci_core.c:975 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 4088: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xda/0x210 mm/slub.c:4567 skb_free_head net/core/skbuff.c:662 [inline] skb_release_data+0x586/0x790 net/core/skbuff.c:691 skb_release_all net/core/skbuff.c:756 [inline] __kfree_skb+0x56/0x1d0 net/core/skbuff.c:770 kfree_skb include/linux/skbuff.h:1206 [inline] hci_dev_open_sync+0x622/0x8d0 net/bluetooth/hci_sync.c:4377 hci_dev_do_open net/bluetooth/hci_core.c:483 [inline] hci_power_on+0x16a/0x610 net/bluetooth/hci_core.c:975 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88806f397800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88806f397800, ffff88806f397a00) The buggy address belongs to the physical page: page:ffffea0001bce500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6f394 head:ffffea0001bce500 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00007c5000 dead000000000002 ffff888012041c80 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4076, tgid 4076 (syz-executor.2), ts 78853550189, free_ts 54328543864 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0x70/0xf0 mm/slub.c:1829 allocate_slab+0x5e/0x520 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] __kmalloc_node_track_caller+0x2c3/0x400 mm/slub.c:4964 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0x11d/0x620 net/core/skbuff.c:434 alloc_skb include/linux/skbuff.h:1257 [inline] nlmsg_new include/net/netlink.h:953 [inline] netlink_ack+0x37a/0xb40 net/netlink/af_netlink.c:2436 netlink_rcv_skb+0x289/0x460 net/netlink/af_netlink.c:2507 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x7e7/0x9c0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x9b3/0xcd0 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] __sys_sendto+0x46d/0x5f0 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3476 __vunmap+0x867/0x9d0 mm/vmalloc.c:2696 kcov_put kernel/kcov.c:421 [inline] kcov_close+0x27/0x50 kernel/kcov.c:517 __fput+0x3b9/0x820 fs/file_table.c:320 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x55e/0x20a0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 get_signal+0x172f/0x1780 kernel/signal.c:2857 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:166 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88806f397700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806f397780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88806f397800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806f397880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806f397900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================