Bluetooth: hci3: hardware error 0xf8
=========================
WARNING: held lock freed!
6.0.0-rc1-syzkaller-00017-g3cc40a443a04 #0 Not tainted
-------------------------
kworker/u19:6/3722 is freeing memory ffff88801fb04000-ffff88801fb047ff, with a lock still held there!
ffff88801fb04520 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_chan_lock include/net/bluetooth/l2cap.h:855 [inline]
ffff88801fb04520 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_conn_del+0x3b5/0x7b0 net/bluetooth/l2cap_core.c:1920
7 locks held by kworker/u19:6/3722:
#0: ffff888000851138 ((wq_completion)hci3){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888000851138 ((wq_completion)hci3){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff888000851138 ((wq_completion)hci3){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
#0: ffff888000851138 ((wq_completion)hci3){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
#0: ffff888000851138 ((wq_completion)hci3){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
#0: ffff888000851138 ((wq_completion)hci3){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
#1: ffffc9000305fda8 ((work_completion)(&hdev->error_reset)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
#2: ffff888044a84fd0 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x25/0x70 net/bluetooth/hci_core.c:552
#3: ffff888044a84078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x268/0x1130 net/bluetooth/hci_sync.c:4463
#4: ffffffff8d9c4f68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1776 [inline]
#4: ffffffff8d9c4f68 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xd5/0x260 net/bluetooth/hci_conn.c:2366
#5: ffff8880262872d8 (&conn->chan_lock){+.+.}-{3:3}, at: l2cap_conn_del+0x2ef/0x7b0 net/bluetooth/l2cap_core.c:1915
#6: ffff88801fb04520 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_chan_lock include/net/bluetooth/l2cap.h:855 [inline]
#6: ffff88801fb04520 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_conn_del+0x3b5/0x7b0 net/bluetooth/l2cap_core.c:1920
stack backtrace:
CPU: 2 PID: 3722 Comm: kworker/u19:6 Not tainted 6.0.0-rc1-syzkaller-00017-g3cc40a443a04 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Workqueue: hci3 hci_error_reset
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_freed_lock_bug kernel/locking/lockdep.c:6422 [inline]
debug_check_no_locks_freed.cold+0x9d/0xa9 kernel/locking/lockdep.c:6455
kfree+0xce/0x390 mm/slab.c:3783
l2cap_chan_destroy net/bluetooth/l2cap_core.c:503 [inline]
kref_put include/linux/kref.h:65 [inline]
l2cap_chan_put+0x22a/0x2d0 net/bluetooth/l2cap_core.c:527
l2cap_conn_del+0x3fc/0x7b0 net/bluetooth/l2cap_core.c:1924
l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8212 [inline]
l2cap_disconn_cfm+0x8c/0xc0 net/bluetooth/l2cap_core.c:8205
hci_disconn_cfm include/net/bluetooth/hci_core.h:1779 [inline]
hci_conn_hash_flush+0x122/0x260 net/bluetooth/hci_conn.c:2366
hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476
hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554
hci_error_reset+0x96/0x130 net/bluetooth/hci_core.c:1050
process_one_work+0x991/0x1610 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
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [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 ffff88801fb044b8 by task kworker/u19:6/3722
CPU: 2 PID: 3722 Comm: kworker/u19:6 Not tainted 6.0.0-rc1-syzkaller-00017-g3cc40a443a04 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Workqueue: hci3 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:317 [inline]
print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433
kasan_report+0xb1/0x1e0 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:71 [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:1926
l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8212 [inline]
l2cap_disconn_cfm+0x8c/0xc0 net/bluetooth/l2cap_core.c:8205
hci_disconn_cfm include/net/bluetooth/hci_core.h:1779 [inline]
hci_conn_hash_flush+0x122/0x260 net/bluetooth/hci_conn.c:2366
hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476
hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554
hci_error_reset+0x96/0x130 net/bluetooth/hci_core.c:1050
process_one_work+0x991/0x1610 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 3722:
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:437 [inline]
____kasan_kmalloc mm/kasan/common.c:516 [inline]
____kasan_kmalloc mm/kasan/common.c:475 [inline]
__kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:525
kasan_kmalloc include/linux/kasan.h:234 [inline]
kmem_cache_alloc_trace+0x25a/0x460 mm/slab.c:3559
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:733 [inline]
l2cap_chan_create+0x40/0x570 net/bluetooth/l2cap_core.c:463
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:7569 [inline]
l2cap_recv_frame+0x48e3/0x8d90 net/bluetooth/l2cap_core.c:7724
l2cap_recv_acldata+0xaa6/0xc00 net/bluetooth/l2cap_core.c:8429
hci_acldata_packet net/bluetooth/hci_core.c:3777 [inline]
hci_rx_work+0x705/0x1230 net/bluetooth/hci_core.c:4012
process_one_work+0x991/0x1610 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 3722:
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:367 [inline]
____kasan_slab_free+0x13d/0x1a0 mm/kasan/common.c:329
kasan_slab_free include/linux/kasan.h:200 [inline]
__cache_free mm/slab.c:3418 [inline]
kfree+0x173/0x390 mm/slab.c:3786
l2cap_chan_destroy net/bluetooth/l2cap_core.c:503 [inline]
kref_put include/linux/kref.h:65 [inline]
l2cap_chan_put+0x22a/0x2d0 net/bluetooth/l2cap_core.c:527
l2cap_conn_del+0x3fc/0x7b0 net/bluetooth/l2cap_core.c:1924
l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8212 [inline]
l2cap_disconn_cfm+0x8c/0xc0 net/bluetooth/l2cap_core.c:8205
hci_disconn_cfm include/net/bluetooth/hci_core.h:1779 [inline]
hci_conn_hash_flush+0x122/0x260 net/bluetooth/hci_conn.c:2366
hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476
hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554
hci_error_reset+0x96/0x130 net/bluetooth/hci_core.c:1050
process_one_work+0x991/0x1610 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
The buggy address belongs to the object at ffff88801fb04000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1208 bytes inside of
2048-byte region [ffff88801fb04000, ffff88801fb04800)
The buggy address belongs to the physical page:
page:ffffea00007ec100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fb04
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea00006fac88 ffffea000089c348 ffff888011840800
raw: 0000000000000000 ffff88801fb04000 0000000100000001 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 0x2d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3711, tgid 3711 (syz-executor.1), ts 227645841758, free_ts 225066662159
prep_new_page mm/page_alloc.c:2532 [inline]
get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283
__alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515
__alloc_pages_node include/linux/gfp.h:243 [inline]
kmem_getpages mm/slab.c:1363 [inline]
cache_grow_begin+0x75/0x360 mm/slab.c:2569
cache_alloc_refill+0x27f/0x380 mm/slab.c:2942
____cache_alloc mm/slab.c:3018 [inline]
____cache_alloc mm/slab.c:3001 [inline]
slab_alloc_node mm/slab.c:3220 [inline]
kmem_cache_alloc_node_trace+0x50a/0x570 mm/slab.c:3601
__do_kmalloc_node mm/slab.c:3623 [inline]
__kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3638
kmalloc_reserve net/core/skbuff.c:358 [inline]
pskb_expand_head+0x203/0x1110 net/core/skbuff.c:1725
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:1033 [inline]
nlmsg_notify+0x8f/0x280 net/netlink/af_netlink.c:2544
rtnl_notify net/core/rtnetlink.c:767 [inline]
rtmsg_ifinfo_send net/core/rtnetlink.c:3928 [inline]
rtmsg_ifinfo_event net/core/rtnetlink.c:3943 [inline]
rtmsg_ifinfo_event net/core/rtnetlink.c:3931 [inline]
rtmsg_ifinfo+0xf0/0x120 net/core/rtnetlink.c:3949
register_netdevice+0x12f1/0x1680 net/core/dev.c:10117
nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline]
nsim_create+0x3c3/0x520 drivers/net/netdevsim/netdev.c:365
__nsim_dev_port_add+0x2bb/0x880 drivers/net/netdevsim/dev.c:1379
nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1437 [inline]
nsim_drv_probe+0xd7d/0x1310 drivers/net/netdevsim/dev.c:1591
call_driver_probe drivers/base/dd.c:530 [inline]
really_probe+0x249/0xb90 drivers/base/dd.c:609
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1449 [inline]
free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499
free_unref_page_prepare mm/page_alloc.c:3380 [inline]
free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476
slab_destroy mm/slab.c:1615 [inline]
slabs_destroy+0x89/0xc0 mm/slab.c:1635
cache_flusharray mm/slab.c:3389 [inline]
___cache_free+0x2a8/0x3d0 mm/slab.c:3452
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:447
kasan_slab_alloc include/linux/kasan.h:224 [inline]
slab_post_alloc_hook mm/slab.h:727 [inline]
slab_alloc_node mm/slab.c:3232 [inline]
kmem_cache_alloc_node+0x2f1/0x560 mm/slab.c:3583
__alloc_skb+0x210/0x2f0 net/core/skbuff.c:418
alloc_skb include/linux/skbuff.h:1257 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
netlink_ack+0x1f0/0xa80 net/netlink/af_netlink.c:2436
netlink_rcv_skb+0x33d/0x420 net/netlink/af_netlink.c:2507
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345
netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:734
__sys_sendto+0x236/0x340 net/socket.c:2117
__do_sys_sendto net/socket.c:2129 [inline]
__se_sys_sendto net/socket.c:2125 [inline]
__x64_sys_sendto+0xdd/0x1b0 net/socket.c:2125
Memory state around the buggy address:
ffff88801fb04380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801fb04400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801fb04480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801fb04500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801fb04580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================