================================================================== BUG: KASAN: slab-use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:199 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock_common kernel/locking/mutex.c:694 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock+0x1a24/0x1ca0 kernel/locking/mutex.c:776 Read of size 8 at addr ffff88805621d320 by task kworker/2:0/24 CPU: 2 UID: 0 PID: 24 Comm: kworker/2:0 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 __mutex_waiter_is_first kernel/locking/mutex.c:199 [inline] __mutex_lock_common kernel/locking/mutex.c:694 [inline] __mutex_lock+0x1a24/0x1ca0 kernel/locking/mutex.c:776 l2cap_chan_timeout+0x6d/0x340 net/bluetooth/l2cap_core.c:417 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 13002: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] l2cap_conn_add.part.0+0x60/0xa90 net/bluetooth/l2cap_core.c:6887 l2cap_conn_add include/net/bluetooth/hci_core.h:1686 [inline] l2cap_chan_connect+0x1691/0x2150 net/bluetooth/l2cap_core.c:7078 l2cap_sock_connect+0x3ba/0x770 net/bluetooth/l2cap_sock.c:256 kernel_connect+0x107/0x180 net/socket.c:3634 rfcomm_session_create net/bluetooth/rfcomm/core.c:811 [inline] __rfcomm_dlc_open net/bluetooth/rfcomm/core.c:388 [inline] rfcomm_dlc_open+0x84a/0xaf0 net/bluetooth/rfcomm/core.c:431 rfcomm_sock_connect+0x423/0x6a0 net/bluetooth/rfcomm/sock.c:410 __sys_connect_file+0x141/0x1a0 net/socket.c:2089 __sys_connect+0x13b/0x160 net/socket.c:2108 __do_sys_connect net/socket.c:2114 [inline] __se_sys_connect net/socket.c:2111 [inline] __x64_sys_connect+0x72/0xb0 net/socket.c:2111 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 13257: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6670 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6878 l2cap_conn_free net/bluetooth/l2cap_core.c:1812 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_conn_put net/bluetooth/l2cap_core.c:1824 [inline] l2cap_conn_del+0x5c7/0x760 net/bluetooth/l2cap_core.c:1804 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7326 [inline] l2cap_disconn_cfm+0x95/0xf0 net/bluetooth/l2cap_core.c:7319 hci_disconn_cfm include/net/bluetooth/hci_core.h:2146 [inline] hci_conn_hash_flush+0x10e/0x290 net/bluetooth/hci_conn.c:2637 hci_dev_close_sync+0x601/0x1260 net/bluetooth/hci_sync.c:5326 hci_dev_do_close+0x2e/0xc0 net/bluetooth/hci_core.c:501 hci_unregister_dev+0x227/0x680 net/bluetooth/hci_core.c:2715 vhci_release+0x17d/0x230 drivers/bluetooth/hci_vhci.c:690 __fput+0x402/0xb70 fs/file_table.c:468 task_work_run+0x150/0x240 kernel/task_work.c:233 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x87f/0x2bd0 kernel/exit.c:971 do_group_exit+0xd3/0x2a0 kernel/exit.c:1112 get_signal+0x2671/0x26d0 kernel/signal.c:3034 arch_do_signal_or_restart+0x8f/0x7e0 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:41 [inline] exit_to_user_mode_loop+0x8c/0x540 kernel/entry/common.c:75 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] do_syscall_64+0x4ee/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805621d000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 800 bytes inside of freed 1024-byte region [ffff88805621d000, ffff88805621d400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88805621b800 pfn:0x56218 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b442dc0 ffffea00008f6210 ffffea00014f9a10 raw: ffff88805621b800 000000000010000a 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801b442dc0 ffffea00008f6210 ffffea00014f9a10 head: ffff88805621b800 000000000010000a 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001588601 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1164, tgid 1164 (kworker/u32:9), ts 57477642630, free_ts 57343092386 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1857 prep_new_page mm/page_alloc.c:1865 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_noprof+0x4fc/0x910 mm/slub.c:5669 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] ieee802_11_parse_elems_full+0x1db/0x3780 net/mac80211/parse.c:1031 ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2469 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1571 [inline] ieee80211_ibss_rx_queued_mgmt+0xc85/0x2fc0 net/mac80211/ibss.c:1602 ieee80211_iface_process_skb net/mac80211/iface.c:1736 [inline] ieee80211_iface_work+0xe28/0x1350 net/mac80211/iface.c:1790 cfg80211_wiphy_work+0x3fb/0x560 net/wireless/core.c:438 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 page last free pid 6176 tgid 6175 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1406 [inline] __free_pages_ok+0x725/0xf80 mm/page_alloc.c:1582 skb_kfree_head net/core/skbuff.c:1068 [inline] skb_free_head+0x114/0x210 net/core/skbuff.c:1080 skb_release_data+0x795/0x9e0 net/core/skbuff.c:1107 skb_release_all net/core/skbuff.c:1182 [inline] __kfree_skb net/core/skbuff.c:1196 [inline] consume_skb net/core/skbuff.c:1428 [inline] consume_skb+0xbf/0x100 net/core/skbuff.c:1422 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x5b2/0x870 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] ____sys_sendmsg+0xa5d/0xc30 net/socket.c:2592 ___sys_sendmsg+0x134/0x1d0 net/socket.c:2646 __sys_sendmsg+0x16d/0x220 net/socket.c:2678 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805621d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805621d280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805621d300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805621d380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805621d400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================