================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24f/0x260 net/bluetooth/hci_core.c:1495 Read of size 2 at addr ffff88803dfd0008 by task kworker/u5:0/11454 CPU: 1 PID: 11454 Comm: kworker/u5:0 Not tainted 6.1.0-rc5-syzkaller-00326-g77c51ba552a1 #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+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 hci_cmd_timeout+0x24f/0x260 net/bluetooth/hci_core.c:1495 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3685: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/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+0x5b/0xc0 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xdd/0x300 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 net/bluetooth/hci_sync.c:54 [inline] hci_cmd_sync_add net/bluetooth/hci_sync.c:95 [inline] __hci_cmd_sync_sk+0x56c/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+0xc6/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+0x1789/0x21a0 net/bluetooth/hci_sync.c:4664 hci_dev_do_open+0x2d/0x70 net/bluetooth/hci_core.c:483 hci_power_on+0xde/0x620 net/bluetooth/hci_core.c:984 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/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+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3343 ma_put net/ipv6/mcast.c:869 [inline] ma_put+0x11c/0x180 net/ipv6/mcast.c:865 __ipv6_dev_mc_dec+0x27c/0x340 net/ipv6/mcast.c:982 ipv6_mc_destroy_dev+0x2ca/0x630 net/ipv6/mcast.c:2800 addrconf_ifdown.isra.0+0x12c2/0x1920 net/ipv6/addrconf.c:3893 addrconf_notify+0x104/0x1c80 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+0x9f9/0x1930 net/core/dev.c:10847 ip6_tnl_exit_batch_net+0x5f9/0x890 net/ipv6/ip6_tunnel.c:2280 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb00 net/core/net_namespace.c:601 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/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+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 call_rcu+0x9d/0x820 kernel/rcu/tree.c:2798 inetdev_destroy net/ipv4/devinet.c:331 [inline] inetdev_event+0x10e5/0x1650 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+0x9f9/0x1930 net/core/dev.c:10847 ip_tunnel_delete_nets+0x3a3/0x5c0 net/ipv4/ip_tunnel.c:1126 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb00 net/core/net_namespace.c:601 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/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 ffff88803dfd0000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88803dfd0000, ffff88803dfd0200) The buggy address belongs to the physical page: page:ffffea0000f7f400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3dfd0 head:ffffea0000f7f400 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3667, tgid 3667 (syz-executor.0), ts 317913236856, free_ts 317911682737 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5555 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x199/0x3e0 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:975 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0xdd/0x300 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1267 [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+0x10f3/0x1620 lib/kobject_uevent.c:593 device_add+0xb76/0x1e90 drivers/base/core.c:3498 netdev_register_kobject+0x185/0x400 net/core/net-sysfs.c:2015 register_netdevice+0xd99/0x1670 net/core/dev.c:10057 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline] nsim_create+0x3c7/0x530 drivers/net/netdevsim/netdev.c:365 __nsim_dev_port_add+0x2d7/0x8f0 drivers/net/netdevsim/dev.c:1396 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+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483 __stack_depot_save+0x16d/0x560 lib/stackdepot.c:506 kasan_save_stack+0x35/0x40 mm/kasan/common.c:46 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] device_private_init drivers/base/core.c:3361 [inline] device_add+0x116c/0x1e90 drivers/base/core.c:3411 netdev_register_kobject+0x185/0x400 net/core/net-sysfs.c:2015 register_netdevice+0xd99/0x1670 net/core/dev.c:10057 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline] nsim_create+0x3c7/0x530 drivers/net/netdevsim/netdev.c:365 __nsim_dev_port_add+0x2d7/0x8f0 drivers/net/netdevsim/dev.c:1396 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1454 [inline] nsim_drv_probe+0xd84/0x1320 drivers/net/netdevsim/dev.c:1608 call_driver_probe drivers/base/dd.c:560 [inline] really_probe+0x249/0xb90 drivers/base/dd.c:639 __driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:778 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:808 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:936 Memory state around the buggy address: ffff88803dfcff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803dfcff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803dfd0000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803dfd0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803dfd0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================