Bluetooth: hci5: hardware error 0xff ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:72 [inline] BUG: KASAN: use-after-free in atomic_long_read include/linux/atomic/atomic-instrumented.h:1265 [inline] BUG: KASAN: use-after-free in __mutex_unlock_slowpath+0xa6/0x5e0 kernel/locking/mutex.c:916 Read of size 8 at addr ffff88803a8e34b8 by task kworker/u5:2/3658 CPU: 0 PID: 3658 Comm: kworker/u5:2 Not tainted 6.0.0-rc6-next-20220923-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: hci5 hci_error_reset Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 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+0xbb/0x1f0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:72 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:1265 [inline] __mutex_unlock_slowpath+0xa6/0x5e0 kernel/locking/mutex.c:916 l2cap_chan_unlock include/net/bluetooth/l2cap.h:860 [inline] l2cap_conn_del+0x404/0x7b0 net/bluetooth/l2cap_core.c:1932 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8214 [inline] l2cap_disconn_cfm+0x8c/0xc0 net/bluetooth/l2cap_core.c:8207 hci_disconn_cfm include/net/bluetooth/hci_core.h:1787 [inline] hci_conn_hash_flush+0x122/0x260 net/bluetooth/hci_conn.c:2430 hci_dev_close_sync+0x5c4/0x1200 net/bluetooth/hci_sync.c:4804 hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554 hci_error_reset+0x9e/0x140 net/bluetooth/hci_core.c:1059 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3667: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa1/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:695 [inline] l2cap_chan_create+0x40/0x930 net/bluetooth/l2cap_core.c:466 a2mp_chan_open net/bluetooth/a2mp.c:771 [inline] amp_mgr_create+0x8f/0x960 net/bluetooth/a2mp.c:862 a2mp_channel_create+0x7d/0x150 net/bluetooth/a2mp.c:894 l2cap_data_channel net/bluetooth/l2cap_core.c:7571 [inline] l2cap_recv_frame+0x48e3/0x8d90 net/bluetooth/l2cap_core.c:7726 l2cap_recv_acldata+0xaa6/0xc00 net/bluetooth/l2cap_core.c:8431 hci_acldata_packet net/bluetooth/hci_core.c:3793 [inline] hci_rx_work+0x705/0x1230 net/bluetooth/hci_core.c:4028 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 3658: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1669 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1695 slab_free mm/slub.c:3599 [inline] __kmem_cache_free+0xab/0x3b0 mm/slub.c:3612 l2cap_chan_destroy net/bluetooth/l2cap_core.c:509 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_chan_put+0x22a/0x2d0 net/bluetooth/l2cap_core.c:533 l2cap_conn_del+0x3fc/0x7b0 net/bluetooth/l2cap_core.c:1930 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8214 [inline] l2cap_disconn_cfm+0x8c/0xc0 net/bluetooth/l2cap_core.c:8207 hci_disconn_cfm include/net/bluetooth/hci_core.h:1787 [inline] hci_conn_hash_flush+0x122/0x260 net/bluetooth/hci_conn.c:2430 hci_dev_close_sync+0x5c4/0x1200 net/bluetooth/hci_sync.c:4804 hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554 hci_error_reset+0x9e/0x140 net/bluetooth/hci_core.c:1059 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/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+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 call_rcu+0x99/0x820 kernel/rcu/tree.c:2796 netlink_release+0xeff/0x1db0 net/netlink/af_netlink.c:815 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16b/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:296 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88803a8e3000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1208 bytes inside of 2048-byte region [ffff88803a8e3000, ffff88803a8e3800) The buggy address belongs to the physical page: page:ffffea0000ea3800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffffea000074a220 pfn:0x3a8e0 head:ffffea0000ea3800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888011842000 dead000000080002 ffff88803a8e4000 raw: ffffea000074a220 ffffea0001ac5220 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3651, tgid 3651 (syz-executor.4), ts 351511648526, free_ts 0 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x1092/0x2d20 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5546 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1739 [inline] allocate_slab+0x213/0x300 mm/slub.c:1884 new_slab mm/slub.c:1937 [inline] ___slab_alloc+0xac1/0x1430 mm/slub.c:3119 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3217 slab_alloc_node mm/slub.c:3302 [inline] __kmem_cache_alloc_node+0x18a/0x3d0 mm/slub.c:3375 __do_kmalloc_node mm/slab_common.c:933 [inline] __kmalloc_node_track_caller+0x45/0xc0 mm/slab_common.c:954 kmalloc_reserve net/core/skbuff.c:362 [inline] pskb_expand_head+0x203/0x1110 net/core/skbuff.c:1730 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1301 netlink_broadcast+0x5f/0xd90 net/netlink/af_netlink.c:1497 nlmsg_multicast include/net/netlink.h:1044 [inline] nlmsg_notify+0x8f/0x280 net/netlink/af_netlink.c:2583 rtnl_notify net/core/rtnetlink.c:767 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3929 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3944 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3932 [inline] rtnetlink_event+0x193/0x1d0 net/core/rtnetlink.c:6142 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] dev_set_mac_address+0x2d3/0x3d0 net/core/dev.c:8816 page_owner free stack trace missing Memory state around the buggy address: ffff88803a8e3380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803a8e3400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88803a8e3480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803a8e3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803a8e3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================