================================================================== BUG: KASAN: use-after-free in hci_cmd_timeout+0x203/0x210 net/bluetooth/hci_core.c:1474 Read of size 2 at addr ffff88806ddf4008 by task kworker/1:6/3751 CPU: 1 PID: 3751 Comm: kworker/1:6 Tainted: G W 5.17.0-syzkaller-02237-g1bc191051dca #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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+0xa5/0x3e0 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 hci_cmd_timeout+0x203/0x210 net/bluetooth/hci_core.c:1474 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 2964: 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+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:584 [inline] kzalloc include/linux/slab.h:717 [inline] kernfs_fop_open+0x31d/0xe00 fs/kernfs/file.c:628 do_dentry_open+0x4b9/0x1250 fs/open.c:824 do_open fs/namei.c:3476 [inline] path_openat+0x1c9e/0x2940 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4d0 fs/open.c:1214 do_sys_open fs/open.c:1230 [inline] __do_sys_openat fs/open.c:1246 [inline] __se_sys_openat fs/open.c:1241 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1241 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+0x44/0xae Freed by task 3713: 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+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:215 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3523 [inline] kfree+0xd6/0x4d0 mm/slub.c:4576 skb_free_head net/core/skbuff.c:655 [inline] skb_release_data+0x6a1/0x7e0 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:1114 [inline] hci_dev_open_sync+0x9e4/0x20c0 net/bluetooth/hci_sync.c:4009 hci_dev_do_open+0x32/0x70 net/bluetooth/hci_core.c:482 hci_power_on+0x133/0x640 net/bluetooth/hci_core.c:963 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88806ddf4000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88806ddf4000, ffff88806ddf4200) The buggy address belongs to the page: page:ffffea0001b77d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6ddf4 head:ffffea0001b77d00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001b36b00 dead000000000002 ffff888010c41c80 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3752, ts 1587095037829, free_ts 10018840825 prep_new_page mm/page_alloc.c:2382 [inline] get_page_from_freelist+0xba2/0x3df0 mm/page_alloc.c:4123 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5349 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2262 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8d0/0xf30 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node_track_caller+0x2cb/0x360 mm/slub.c:4971 kmalloc_reserve net/core/skbuff.c:354 [inline] pskb_expand_head+0x15e/0x1110 net/core/skbuff.c:1699 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1299 netlink_broadcast+0x5b/0xd50 net/netlink/af_netlink.c:1495 nlmsg_multicast include/net/netlink.h:1033 [inline] genlmsg_multicast_netns include/net/genetlink.h:311 [inline] team_nl_send_multicast+0xe6/0x150 drivers/net/team/team.c:2845 team_nl_send_port_list_get+0x5ff/0x6c0 drivers/net/team/team.c:2772 team_nl_send_event_port_get drivers/net/team/team.c:2859 [inline] __team_port_change_send+0x23e/0x4a0 drivers/net/team/team.c:2917 __team_port_change_check drivers/net/team/team.c:2949 [inline] team_port_change_check drivers/net/team/team.c:2971 [inline] team_device_event+0x652/0xa90 drivers/net/team/team.c:3000 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1348 [inline] free_pcp_prepare+0x548/0xd10 mm/page_alloc.c:1400 free_unref_page_prepare mm/page_alloc.c:3269 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3364 free_contig_range+0xb1/0x180 mm/page_alloc.c:9358 destroy_args+0xa8/0x646 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x2a50/0x2ae2 mm/debug_vm_pgtable.c:1332 do_one_initcall+0x103/0x650 init/main.c:1300 do_initcall_level init/main.c:1373 [inline] do_initcalls init/main.c:1389 [inline] do_basic_setup init/main.c:1408 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1613 kernel_init+0x1a/0x1d0 init/main.c:1502 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88806ddf3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806ddf3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88806ddf4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806ddf4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806ddf4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================