================================================================== BUG: KASAN: use-after-free in hci_sock_get_cookie+0x41/0x50 net/bluetooth/hci_sock.c:95 Read of size 4 at addr ffff88807c15f5c8 by task kworker/u5:2/4256 CPU: 0 PID: 4256 Comm: kworker/u5:2 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Workqueue: hci0 hci_power_on Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 hci_sock_get_cookie+0x41/0x50 net/bluetooth/hci_sock.c:95 mgmt_cmd_status+0x1b3/0x470 net/bluetooth/mgmt_util.c:116 mgmt_set_powered_failed+0xa7/0xf0 net/bluetooth/mgmt.c:8672 hci_power_on+0x2b0/0x5f0 net/bluetooth/hci_core.c:2286 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 5197: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:612 [inline] sk_prot_alloc+0xe7/0x210 net/core/sock.c:1865 sk_alloc+0x2f/0x310 net/core/sock.c:1921 bt_sock_alloc+0x37/0x350 net/bluetooth/af_bluetooth.c:146 hci_sock_create+0x9f/0x180 net/bluetooth/hci_sock.c:2108 bt_sock_create+0x155/0x220 net/bluetooth/af_bluetooth.c:130 __sock_create+0x473/0x910 net/socket.c:1496 sock_create net/socket.c:1552 [inline] __sys_socket+0xe2/0x170 net/socket.c:1594 __do_sys_socket net/socket.c:1603 [inline] __se_sys_socket net/socket.c:1601 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1601 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 5202: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1710 [inline] slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736 slab_free mm/slub.c:3504 [inline] kfree+0xef/0x2a0 mm/slub.c:4564 sk_prot_free net/core/sock.c:1904 [inline] __sk_destruct+0x580/0x840 net/core/sock.c:1990 sock_put include/net/sock.h:1990 [inline] mgmt_pending_free net/bluetooth/mgmt_util.c:261 [inline] mgmt_pending_remove+0x13d/0x1a0 net/bluetooth/mgmt_util.c:269 mgmt_pending_foreach+0xc1/0x110 net/bluetooth/mgmt_util.c:226 mgmt_index_removed+0x125/0x2a0 net/bluetooth/mgmt.c:8551 hci_sock_bind+0xa8f/0xe20 net/bluetooth/hci_sock.c:1259 __sys_bind+0x2e9/0x3e0 net/socket.c:1730 __do_sys_bind net/socket.c:1741 [inline] __se_sys_bind net/socket.c:1739 [inline] __x64_sys_bind+0x76/0x80 net/socket.c:1739 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88807c15f000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1480 bytes inside of 2048-byte region [ffff88807c15f000, ffff88807c15f800) The buggy address belongs to the page: page:ffffea0001f05600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c158 head:ffffea0001f05600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017842000 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4743, ts 88703026825, free_ts 84427122709 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501 alloc_slab_page mm/slub.c:1780 [inline] allocate_slab mm/slub.c:1917 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1980 ___slab_alloc+0x807/0xdd0 mm/slub.c:3013 __slab_alloc mm/slub.c:3100 [inline] slab_alloc_node mm/slub.c:3191 [inline] __kmalloc_node_track_caller+0x13d/0x3a0 mm/slub.c:4963 kmalloc_reserve net/core/skbuff.c:356 [inline] pskb_expand_head+0x128/0x1100 net/core/skbuff.c:1714 netlink_trim+0x180/0x220 net/netlink/af_netlink.c:1295 netlink_broadcast_filtered+0x69/0x1240 net/netlink/af_netlink.c:1520 netlink_broadcast net/netlink/af_netlink.c:1565 [inline] nlmsg_multicast include/net/netlink.h:1044 [inline] nlmsg_notify+0xdf/0x190 net/netlink/af_netlink.c:2570 rtnl_notify net/core/rtnetlink.c:764 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3922 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3937 [inline] rtnetlink_event+0x13a/0x1a0 net/core/rtnetlink.c:5749 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391 netdev_lower_state_changed+0xd1/0x150 net/core/dev.c:8633 team_lower_state_changed drivers/net/team/team.c:89 [inline] team_refresh_port_linkup drivers/net/team/team.c:99 [inline] __team_port_change_send+0x1d9/0x570 drivers/net/team/team.c:2970 __team_port_change_port_added+0x28/0x150 drivers/net/team/team.c:3023 team_port_add drivers/net/team/team.c:1318 [inline] team_add_slave+0x20db/0x2840 drivers/net/team/team.c:2014 do_set_master net/core/rtnetlink.c:2589 [inline] do_setlink+0xe79/0x29d0 net/core/rtnetlink.c:2800 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396 __vunmap+0x8e0/0xa80 mm/vmalloc.c:2661 kcov_put kernel/kcov.c:422 [inline] kcov_close+0x27/0x50 kernel/kcov.c:524 __fput+0x212/0x8c0 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0x635/0x2100 kernel/exit.c:890 do_group_exit+0x12c/0x2f0 kernel/exit.c:1004 get_signal+0x7eb/0x12e0 kernel/signal.c:2917 arch_do_signal_or_restart+0xe6/0x12a0 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:157 [inline] exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff88807c15f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807c15f500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807c15f580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807c15f600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807c15f680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================