Bluetooth: hci6: command 0xfc11 tx timeout ================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x203/0x210 net/bluetooth/hci_core.c:2774 Read of size 2 at addr ffff88807c6d3008 by task kworker/0:5/8331 CPU: 0 PID: 8331 Comm: kworker/0:5 Not tainted 5.15.0-rc6-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+0xcd/0x134 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+0x203/0x210 net/bluetooth/hci_core.c:2774 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 21390: 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_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa4/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] alloc_bprm+0x51/0x8f0 fs/exec.c:1505 kernel_execve+0x55/0x460 fs/exec.c:1945 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 10023: 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+0x8b/0x1c0 mm/slub.c:1726 slab_free mm/slub.c:3492 [inline] kfree+0xf3/0x550 mm/slub.c:4552 skb_free_head net/core/skbuff.c:654 [inline] skb_release_data+0x65a/0x790 net/core/skbuff.c:676 skb_release_all net/core/skbuff.c:741 [inline] __kfree_skb net/core/skbuff.c:755 [inline] kfree_skb net/core/skbuff.c:773 [inline] kfree_skb+0x133/0x3f0 net/core/skbuff.c:767 hci_dev_do_open+0xa50/0x1a00 net/bluetooth/hci_core.c:1634 hci_power_on+0x133/0x650 net/bluetooth/hci_core.c:2263 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe9/0x110 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2987 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3067 inetdev_destroy net/ipv4/devinet.c:328 [inline] inetdev_event+0xd4c/0x15d0 net/ipv4/devinet.c:1598 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many+0x951/0x1790 net/core/dev.c:11043 ip_tunnel_delete_nets+0x39f/0x5b0 net/ipv4/ip_tunnel.c:1123 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:591 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe9/0x110 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2987 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3067 __key_link+0x146/0x360 security/keys/keyring.c:1372 key_link+0x24b/0x340 security/keys/keyring.c:1458 look_up_user_keyrings+0x51c/0x740 security/keys/process_keys.c:141 lookup_user_key+0x25f/0x11e0 security/keys/process_keys.c:704 __do_sys_request_key+0x1a4/0x3b0 security/keys/keyctl.c:206 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+0x44/0xae The buggy address belongs to the object at ffff88807c6d3000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88807c6d3000, ffff88807c6d3200) The buggy address belongs to the page: page:ffffea0001f1b400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c6d0 head:ffffea0001f1b400 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010c41c80 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 19, ts 134813285844, free_ts 123620716901 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4153 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1770 [inline] allocate_slab mm/slub.c:1907 [inline] new_slab+0x319/0x490 mm/slub.c:1970 ___slab_alloc+0x950/0x1050 mm/slub.c:3001 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3088 slab_alloc_node mm/slub.c:3179 [inline] __kmalloc_node_track_caller+0x2d2/0x340 mm/slub.c:4947 kmalloc_reserve net/core/skbuff.c:355 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 __napi_alloc_skb+0x70/0x310 net/core/skbuff.c:567 napi_alloc_skb include/linux/skbuff.h:2934 [inline] page_to_skb+0x192/0xd90 drivers/net/virtio_net.c:434 receive_mergeable drivers/net/virtio_net.c:1025 [inline] receive_buf+0x3238/0x65c0 drivers/net/virtio_net.c:1135 virtnet_receive drivers/net/virtio_net.c:1427 [inline] virtnet_poll+0x5bf/0x1190 drivers/net/virtio_net.c:1536 __napi_poll+0xaf/0x440 net/core/dev.c:6986 napi_poll net/core/dev.c:7053 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:7140 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 run_ksoftirqd kernel/softirq.c:920 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:912 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+0x19/0x690 mm/page_alloc.c:3394 __put_page+0x105/0x400 mm/swap.c:127 put_page include/linux/mm.h:1247 [inline] __skb_frag_unref include/linux/skbuff.h:3107 [inline] skb_release_data+0x49d/0x790 net/core/skbuff.c:671 skb_release_all net/core/skbuff.c:741 [inline] __kfree_skb+0x46/0x60 net/core/skbuff.c:755 sk_eat_skb include/net/sock.h:2629 [inline] tcp_recvmsg_locked+0x12f7/0x2320 net/ipv4/tcp.c:2506 tcp_recvmsg+0x134/0x550 net/ipv4/tcp.c:2552 inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:852 sock_recvmsg_nosec net/socket.c:944 [inline] sock_recvmsg net/socket.c:962 [inline] sock_recvmsg net/socket.c:958 [inline] sock_read_iter+0x33c/0x470 net/socket.c:1035 call_read_iter include/linux/fs.h:2157 [inline] new_sync_read+0x5ba/0x6e0 fs/read_write.c:404 vfs_read+0x35c/0x600 fs/read_write.c:485 ksys_read+0x1ee/0x250 fs/read_write.c:623 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+0x44/0xae Memory state around the buggy address: ffff88807c6d2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807c6d2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807c6d3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807c6d3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807c6d3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================