================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1474 Read of size 2 at addr ffff88800b97b408 by task kworker/3:3/3729 CPU: 3 PID: 3729 Comm: kworker/3:3 Not tainted 5.18.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 hci_cmd_timeout+0x24b/0x250 net/bluetooth/hci_core.c:1474 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 3714: 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:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1300 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:424 [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+0x56f/0xe30 net/bluetooth/hci_sync.c:157 __hci_cmd_sync+0x34/0x40 net/bluetooth/hci_sync.c:206 btintel_enter_mfg+0x2c/0xb0 drivers/bluetooth/btintel.c:79 ag6xx_setup+0xfc/0x860 drivers/bluetooth/hci_ag6xx.c:165 hci_uart_setup+0x1b1/0x480 drivers/bluetooth/hci_ldisc.c:423 hci_dev_open_sync+0x3bd/0x20b0 net/bluetooth/hci_sync.c:3893 hci_dev_do_open+0x32/0x70 net/bluetooth/hci_core.c:482 hci_power_on+0x133/0x630 net/bluetooth/hci_core.c:963 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Freed by task 3714: 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:366 [inline] ____kasan_slab_free+0x13d/0x180 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3439 [inline] kfree+0x113/0x310 mm/slab.c:3810 skb_free_head+0xac/0x110 net/core/skbuff.c:655 skb_release_data+0x67a/0x810 net/core/skbuff.c:677 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb net/core/skbuff.c:756 [inline] kfree_skb_reason.part.0+0xc3/0x2f0 net/core/skbuff.c:776 kfree_skb_reason+0x85/0x110 include/linux/refcount.h:279 kfree_skb include/linux/skbuff.h:1250 [inline] hci_dev_open_sync+0xabd/0x20b0 net/bluetooth/hci_sync.c:4022 hci_dev_do_open+0x32/0x70 net/bluetooth/hci_core.c:482 hci_power_on+0x133/0x630 net/bluetooth/hci_core.c:963 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 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/0x990 kernel/rcu/tree.c:3595 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1705 unregister_sysctl_table fs/proc/proc_sysctl.c:1743 [inline] unregister_sysctl_table+0xc0/0x190 fs/proc/proc_sysctl.c:1718 neigh_sysctl_unregister+0x5b/0x80 net/core/neighbour.c:3812 devinet_sysctl_unregister net/ipv4/devinet.c:2640 [inline] inetdev_destroy net/ipv4/devinet.c:327 [inline] inetdev_event+0xd01/0x15d0 net/ipv4/devinet.c:1604 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1938 call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] unregister_netdevice_many+0x92e/0x1890 net/core/dev.c:10747 vti6_exit_batch_net+0x3a0/0x670 net/ipv6/ip6_vti.c:1190 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 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/0x990 kernel/rcu/tree.c:3595 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1705 unregister_sysctl_table fs/proc/proc_sysctl.c:1743 [inline] unregister_sysctl_table+0xc0/0x190 fs/proc/proc_sysctl.c:1718 neigh_sysctl_unregister+0x5b/0x80 net/core/neighbour.c:3812 devinet_sysctl_unregister net/ipv4/devinet.c:2640 [inline] inetdev_destroy net/ipv4/devinet.c:327 [inline] inetdev_event+0xd01/0x15d0 net/ipv4/devinet.c:1604 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1938 call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] unregister_netdevice_many+0x92e/0x1890 net/core/dev.c:10747 vti6_exit_batch_net+0x3a0/0x670 net/ipv6/ip6_vti.c:1190 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff88800b97b400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88800b97b400, ffff88800b97b600) The buggy address belongs to the physical page: page:ffffea00002e5ec0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xb97b flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000061ebc8 ffffea0000624788 ffff888010c40600 raw: 0000000000000000 ffff88800b97b000 0000000100000004 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 0x2c2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 18422, tgid 18419 (syz-executor.2), ts 736205849583, free_ts 665885468746 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages_slowpath.constprop.0+0x2eb/0x20e0 mm/page_alloc.c:4953 __alloc_pages+0x412/0x500 mm/page_alloc.c:5421 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2584 cache_alloc_refill+0x27f/0x380 mm/slab.c:2957 ____cache_alloc mm/slab.c:3040 [inline] ____cache_alloc mm/slab.c:3023 [inline] slab_alloc_node mm/slab.c:3241 [inline] kmem_cache_alloc_node_trace+0x518/0x5b0 mm/slab.c:3625 __do_kmalloc_node mm/slab.c:3647 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3662 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1300 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet6_ifa_notify+0x118/0x230 net/ipv6/addrconf.c:5475 __ipv6_ifa_notify+0x177/0xa90 net/ipv6/addrconf.c:6122 addrconf_ifdown.isra.0+0xaca/0x16b0 net/ipv6/addrconf.c:3855 addrconf_notify+0xeb/0x1ba0 net/ipv6/addrconf.c:3662 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1938 netdev_state_change net/core/dev.c:1327 [inline] netdev_state_change+0x100/0x130 net/core/dev.c:1320 do_setlink+0x2eca/0x3a20 net/core/rtnetlink.c:2965 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423 slab_destroy mm/slab.c:1630 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1650 cache_flusharray mm/slab.c:3411 [inline] ___cache_free+0x34e/0x670 mm/slab.c:3474 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc mm/slab.c:3316 [inline] __kmem_cache_alloc_lru mm/slab.c:3493 [inline] kmem_cache_alloc+0x265/0x560 mm/slab.c:3513 ptlock_alloc+0x1d/0x70 mm/memory.c:5519 ptlock_init include/linux/mm.h:2300 [inline] pgtable_pte_page_ctor include/linux/mm.h:2327 [inline] __pte_alloc_one include/asm-generic/pgalloc.h:66 [inline] pte_alloc_one+0x68/0x230 arch/x86/mm/pgtable.c:33 __pte_alloc+0x69/0x250 mm/memory.c:465 copy_pte_range mm/memory.c:1022 [inline] copy_pmd_range mm/memory.c:1157 [inline] copy_pud_range mm/memory.c:1194 [inline] copy_p4d_range mm/memory.c:1218 [inline] copy_page_range+0x19e6/0x3e50 mm/memory.c:1291 dup_mmap kernel/fork.c:701 [inline] dup_mm+0xa4e/0x13d0 kernel/fork.c:1521 copy_mm kernel/fork.c:1573 [inline] copy_process+0x3b14/0x6fe0 kernel/fork.c:2234 kernel_clone+0xe7/0xab0 kernel/fork.c:2639 __do_sys_clone+0xc8/0x110 kernel/fork.c:2756 Memory state around the buggy address: ffff88800b97b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88800b97b380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88800b97b400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800b97b480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800b97b500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================