================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1475 Read of size 2 at addr ffff888068171808 by task kworker/1:35/4899 CPU: 1 PID: 4899 Comm: kworker/1:35 Not tainted 5.19.0-rc8-syzkaller-00155-g6a010258447d #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.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1475 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3675: 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:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1426 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:424 [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+0x56f/0xe30 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:2648 hci_init_stage_sync net/bluetooth/hci_sync.c:2559 [inline] hci_init1_sync net/bluetooth/hci_sync.c:2742 [inline] hci_init_sync net/bluetooth/hci_sync.c:3774 [inline] hci_dev_open_sync+0x1b8b/0x2160 net/bluetooth/hci_sync.c:3997 hci_dev_do_open+0x32/0x70 net/bluetooth/hci_core.c:482 hci_power_on+0x133/0x630 net/bluetooth/hci_core.c:964 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 3675: 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:366 [inline] ____kasan_slab_free+0x13d/0x180 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3425 [inline] kfree+0x113/0x310 mm/slab.c:3796 skb_free_head+0xac/0x110 net/core/skbuff.c:655 skb_release_data+0x67f/0x810 net/core/skbuff.c:677 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb net/core/skbuff.c:756 [inline] kfree_skb_reason.part.0+0xe2/0x320 net/core/skbuff.c:778 kfree_skb_reason+0x85/0x110 include/linux/refcount.h:279 kfree_skb include/linux/skbuff.h:1375 [inline] hci_dev_open_sync+0xb8c/0x2160 net/bluetooth/hci_sync.c:4052 hci_dev_do_open+0x32/0x70 net/bluetooth/hci_core.c:482 hci_power_on+0x133/0x630 net/bluetooth/hci_core.c:964 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 call_rcu+0x99/0x790 kernel/rcu/tree.c:3126 inetdev_destroy net/ipv4/devinet.c:331 [inline] inetdev_event+0xd4f/0x15d0 net/ipv4/devinet.c:1602 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1945 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] unregister_netdevice_many+0x948/0x18b0 net/core/dev.c:10843 ip_tunnel_delete_nets+0x39f/0x5b0 net/ipv4/ip_tunnel.c:1124 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/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 ffff888068171800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff888068171800, ffff888068171a00) The buggy address belongs to the physical page: page:ffffea0001a05c40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888068171400 pfn:0x68171 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001a69d08 ffffea0000829a48 ffff888011840600 raw: ffff888068171400 ffff888068171000 0000000100000003 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 0x3c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 3768, tgid 3768 (syz-executor.2), ts 455021286605, free_ts 454653864488 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1298/0x3b80 mm/page_alloc.c:4202 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5430 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3024 [inline] ____cache_alloc mm/slab.c:3007 [inline] slab_alloc_node mm/slab.c:3227 [inline] kmem_cache_alloc_node_trace+0x518/0x5b0 mm/slab.c:3611 __do_kmalloc_node mm/slab.c:3633 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3648 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1426 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1191 [inline] netlink_sendmsg+0x9a2/0xe10 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 __sys_sendto+0x21a/0x320 net/socket.c:2119 __do_sys_sendto net/socket.c:2131 [inline] __se_sys_sendto net/socket.c:2127 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 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:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page_list+0x16f/0xf80 mm/page_alloc.c:3475 release_pages+0xff6/0x2290 mm/swap.c:980 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+0x1de/0x4a0 mm/mmap.c:3164 __mmput+0x122/0x4b0 kernel/fork.c:1187 mmput+0x56/0x60 kernel/fork.c:1208 exit_mm kernel/exit.c:510 [inline] do_exit+0x9f1/0x29d0 kernel/exit.c:782 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x2542/0x2600 kernel/signal.c:2857 arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888068171700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888068171780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888068171800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888068171880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888068171900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================