Bluetooth: hci7: command 0x1003 tx timeout ================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x1c3/0x1f0 net/bluetooth/hci_core.c:1495 Read of size 2 at addr ffff88808e7d8008 by task kworker/u5:6/3677 CPU: 1 PID: 3677 Comm: kworker/u5:6 Not tainted 6.1.0-rc5-syzkaller-00018-g59d0d52c30d4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: hci6 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+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x220 mm/kasan/report.c:395 kasan_report+0x139/0x170 mm/kasan/report.c:495 hci_cmd_timeout+0x1c3/0x1f0 net/bluetooth/hci_core.c:1495 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 48: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc_node_track_caller+0xad/0x190 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0x11d/0x620 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1267 [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:3227 [inline] hci_init_stage_sync net/bluetooth/hci_sync.c:3138 [inline] hci_init1_sync+0x1d6/0x6d0 net/bluetooth/hci_sync.c:3321 hci_init_sync net/bluetooth/hci_sync.c:4396 [inline] hci_dev_init_sync+0x24a/0x6b0 net/bluetooth/hci_sync.c:4584 hci_dev_open_sync+0x34e/0x8e0 net/bluetooth/hci_sync.c:4664 hci_dev_do_open net/bluetooth/hci_core.c:483 [inline] hci_power_on+0x16a/0x610 net/bluetooth/hci_core.c:984 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 48: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:511 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x71/0x110 mm/slub.c:3674 skb_free_head net/core/skbuff.c:760 [inline] skb_release_data+0x536/0x6d0 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+0xd3/0x290 net/core/skbuff.c:891 kfree_skb include/linux/skbuff.h:1216 [inline] hci_dev_open_sync+0x622/0x8e0 net/bluetooth/hci_sync.c:4699 hci_dev_do_open net/bluetooth/hci_core.c:483 [inline] hci_power_on+0x16a/0x610 net/bluetooth/hci_core.c:984 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 ffff88808e7d8000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88808e7d8000, ffff88808e7d8200) The buggy address belongs to the physical page: page:ffffea000239f600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8e7d8 head:ffffea000239f600 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888012841c80 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 3681, tgid 3681 (syz-executor.3), ts 201212533315, free_ts 201209380557 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4288 __alloc_pages+0x259/0x560 mm/page_alloc.c:5555 alloc_slab_page+0x70/0xf0 mm/slub.c:1794 allocate_slab+0x5e/0x4b0 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0x7f4/0xeb0 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x252/0x310 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node_track_caller+0x9c/0x190 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0x11d/0x620 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1267 [inline] alloc_uevent_skb+0x73/0x220 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast+0x177/0x570 lib/kobject_uevent.c:412 kobject_uevent_env+0x6b1/0x8e0 lib/kobject_uevent.c:593 device_add+0xa56/0xf90 drivers/base/core.c:3498 netdev_register_kobject+0x178/0x310 net/core/net-sysfs.c:2015 register_netdevice+0x136c/0x1a20 net/core/dev.c:10057 macvlan_common_newlink+0x10c2/0x1880 drivers/net/macvlan.c:1512 rtnl_newlink_create net/core/rtnetlink.c:3364 [inline] __rtnl_newlink net/core/rtnetlink.c:3581 [inline] rtnl_newlink+0x14ed/0x2060 net/core/rtnetlink.c:3594 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3483 __stack_depot_save+0x430/0x4a0 lib/stackdepot.c:506 kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x61/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1cc/0x300 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:679 [inline] fill_pool lib/debugobjects.c:168 [inline] __debug_object_init+0x1391/0x1860 lib/debugobjects.c:562 debug_timer_init kernel/time/timer.c:777 [inline] debug_init kernel/time/timer.c:825 [inline] init_timer_key+0x39/0x110 kernel/time/timer.c:869 ipv6_mc_init_dev+0x337/0x900 net/ipv6/mcast.c:2768 ipv6_add_dev+0xb1c/0x1150 net/ipv6/addrconf.c:447 addrconf_notify+0x75b/0xfe0 net/ipv6/addrconf.c:3528 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1945 [inline] call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers+0x14e/0x1d0 net/core/dev.c:1997 register_netdevice+0x15d5/0x1a20 net/core/dev.c:10090 macvlan_common_newlink+0x10c2/0x1880 drivers/net/macvlan.c:1512 rtnl_newlink_create net/core/rtnetlink.c:3364 [inline] __rtnl_newlink net/core/rtnetlink.c:3581 [inline] rtnl_newlink+0x14ed/0x2060 net/core/rtnetlink.c:3594 Memory state around the buggy address: ffff88808e7d7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808e7d7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808e7d8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808e7d8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808e7d8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================