================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1495 Read of size 2 at addr ffff88801c78ec08 by task kworker/u5:6/3657 CPU: 1 PID: 3657 Comm: kworker/u5:6 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: hci6 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/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1495 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 3650: 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+0xa6/0xd0 mm/kasan/common.c:525 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1265 [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+0xc2/0x1e0 net/bluetooth/hci_sync.c:3227 hci_init_stage_sync net/bluetooth/hci_sync.c:3138 [inline] hci_init1_sync net/bluetooth/hci_sync.c:3321 [inline] hci_init_sync net/bluetooth/hci_sync.c:4396 [inline] hci_dev_init_sync net/bluetooth/hci_sync.c:4584 [inline] hci_dev_open_sync+0x1785/0x21a0 net/bluetooth/hci_sync.c:4664 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xda/0x620 net/bluetooth/hci_core.c:984 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 3650: 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+0x13d/0x1a0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3418 [inline] kfree+0x173/0x390 mm/slab.c:3786 skb_free_head+0xac/0x110 net/core/skbuff.c:760 skb_release_data+0x5f1/0x870 net/core/skbuff.c:789 skb_release_all net/core/skbuff.c:854 [inline] __kfree_skb net/core/skbuff.c:868 [inline] kfree_skb_reason+0x14e/0x410 net/core/skbuff.c:891 kfree_skb include/linux/skbuff.h:1214 [inline] hci_dev_open_sync+0xbec/0x21a0 net/bluetooth/hci_sync.c:4699 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xda/0x620 net/bluetooth/hci_core.c:984 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 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:2796 inetdev_destroy net/ipv4/devinet.c:331 [inline] inetdev_event+0xd4a/0x1610 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+0xa69/0x1980 net/core/dev.c:10843 ip6_tnl_exit_batch_net+0x5f5/0x890 net/ipv6/ip6_tunnel.c:2279 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 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 Second to 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 kvfree_call_rcu+0x74/0x8f0 kernel/rcu/tree.c:3341 ma_put net/ipv6/mcast.c:869 [inline] ma_put+0x11c/0x180 net/ipv6/mcast.c:865 ipv6_mc_destroy_dev+0x3c0/0x630 net/ipv6/mcast.c:2810 addrconf_ifdown.isra.0+0x12c2/0x1920 net/ipv6/addrconf.c:3893 addrconf_notify+0xeb/0x1c10 net/ipv6/addrconf.c:3673 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+0xa69/0x1980 net/core/dev.c:10843 default_device_exit_batch+0x449/0x590 net/core/dev.c:11337 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 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 ffff88801c78ec00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88801c78ec00, ffff88801c78ee00) The buggy address belongs to the physical page: page:ffffea000071e380 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801c78e000 pfn:0x1c78e flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000ad9648 ffffea0001f82608 ffff888011840600 raw: ffff88801c78e000 ffff88801c78e000 0000000100000002 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 0x2c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3635, tgid 3635 (syz-executor.5), ts 195234561649, free_ts 195163289104 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:5549 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] slab_alloc_node mm/slab.c:3220 [inline] kmem_cache_alloc_node_trace+0x50a/0x570 mm/slab.c:3601 __do_kmalloc_node mm/slab.c:3623 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3638 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1265 [inline] alloc_uevent_skb+0x7b/0x210 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast lib/kobject_uevent.c:412 [inline] kobject_uevent_env+0x110a/0x1640 lib/kobject_uevent.c:593 __kobject_del+0x160/0x1f0 lib/kobject.c:585 kobject_cleanup lib/kobject.c:664 [inline] kobject_release lib/kobject.c:704 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x2ed/0x4c0 lib/kobject.c:721 netdev_queue_update_kobjects+0x367/0x4e0 net/core/net-sysfs.c:1733 netif_set_real_num_tx_queues+0x1b6/0x770 net/core/dev.c:2893 veth_init_queues+0xdd/0x190 drivers/net/veth.c:1687 veth_newlink+0x679/0x990 drivers/net/veth.c:1813 rtnl_newlink_create net/core/rtnetlink.c:3364 [inline] __rtnl_newlink+0x1087/0x17e0 net/core/rtnetlink.c:3581 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+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3389 [inline] ___cache_free+0x2a8/0x3d0 mm/slab.c:3452 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc mm/slab.c:3294 [inline] __kmem_cache_alloc_lru mm/slab.c:3471 [inline] kmem_cache_alloc+0x214/0x520 mm/slab.c:3491 getname_flags.part.0+0x50/0x4f0 fs/namei.c:139 getname_flags include/linux/audit.h:320 [inline] getname+0x8e/0xd0 fs/namei.c:218 do_sys_openat2+0xf5/0x4c0 fs/open.c:1304 do_sys_open fs/open.c:1326 [inline] __do_sys_openat fs/open.c:1342 [inline] __se_sys_openat fs/open.c:1337 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1337 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 Memory state around the buggy address: ffff88801c78eb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801c78eb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801c78ec00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801c78ec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801c78ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================