================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x1c3/0x1f0 net/bluetooth/hci_core.c:1495 Read of size 2 at addr ffff8880b4edf808 by task kworker/u5:0/19469 CPU: 0 PID: 19469 Comm: kworker/u5:0 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+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x220 mm/kasan/report.c:433 kasan_report+0xfb/0x130 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 3666: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:234 [inline] __kmalloc_node_track_caller+0x265/0x400 mm/slub.c:4969 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0x11d/0x620 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+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 3666: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xda/0x210 mm/slub.c:4567 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:1214 [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 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0xa31/0xce0 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x7a2/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x277/0x75b kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0x9c0 kernel/rcu/tree.c:2796 inetdev_destroy net/ipv4/devinet.c:331 [inline] inetdev_event+0x84d/0x1400 net/ipv4/devinet.c:1602 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 net/core/dev.c:1997 [inline] unregister_netdevice_many+0x107e/0x1aa0 net/core/dev.c:10843 ip_tunnel_delete_nets+0x325/0x370 net/ipv4/ip_tunnel.c:1126 ops_exit_list net/core/net_namespace.c:167 [inline] setup_net+0x990/0xc10 net/core/net_namespace.c:348 copy_net_ns+0x359/0x5b0 net/core/net_namespace.c:471 create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110 copy_namespaces+0x333/0x390 kernel/nsproxy.c:178 copy_process+0x1a55/0x3fc0 kernel/fork.c:2257 kernel_clone+0x227/0x640 kernel/fork.c:2672 __do_sys_clone kernel/fork.c:2806 [inline] __se_sys_clone kernel/fork.c:2790 [inline] __x64_sys_clone+0x276/0x2e0 kernel/fork.c:2790 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880b4edf800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff8880b4edf800, ffff8880b4edfa00) The buggy address belongs to the physical page: page:ffffea0002d3b700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xb4edc head:ffffea0002d3b700 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 16905, tgid 16891 (syz-executor.5), ts 1767859282999, free_ts 1763691156425 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 __alloc_pages_node include/linux/gfp.h:243 [inline] alloc_slab_page+0x2e/0xf0 mm/slub.c:1831 allocate_slab+0x5e/0x520 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] __kmalloc_node+0x2cd/0x420 mm/slub.c:4473 kmalloc_array_node include/linux/slab.h:695 [inline] kcalloc_node include/linux/slab.h:700 [inline] memcg_alloc_slab_cgroups+0x7c/0x120 mm/memcontrol.c:2824 account_slab mm/slab.h:630 [inline] allocate_slab+0xa6/0x520 mm/slub.c:1990 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3256 [inline] __kmem_cache_alloc_lru mm/slub.c:3263 [inline] kmem_cache_alloc+0x25d/0x310 mm/slub.c:3273 anon_vma_chain_alloc mm/rmap.c:141 [inline] anon_vma_fork+0x1ec/0x4d0 mm/rmap.c:363 dup_mmap+0x764/0xfc0 kernel/fork.c:658 dup_mm+0x8c/0x310 kernel/fork.c:1524 copy_mm+0x102/0x190 kernel/fork.c:1576 copy_process+0x1973/0x3fc0 kernel/fork.c:2254 kernel_clone+0x227/0x640 kernel/fork.c:2672 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+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3476 free_slab mm/slub.c:2073 [inline] discard_slab mm/slub.c:2079 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2553 put_cpu_partial+0x116/0x180 mm/slub.c:2629 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x2f/0xe0 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_node mm/slub.c:3248 [inline] slab_alloc mm/slub.c:3256 [inline] __kmem_cache_alloc_lru mm/slub.c:3263 [inline] kmem_cache_alloc+0x1a6/0x310 mm/slub.c:3273 getname_flags+0xb8/0x4e0 fs/namei.c:139 getname fs/namei.c:218 [inline] __do_sys_unlink fs/namei.c:4345 [inline] __se_sys_unlink fs/namei.c:4343 [inline] __x64_sys_unlink+0x38/0x50 fs/namei.c:4343 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880b4edf700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880b4edf780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880b4edf800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880b4edf880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b4edf900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================