Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp138285lqm; Tue, 30 Apr 2024 15:51:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDkWs9aQHlgoejpEznxcrZFK90KUyVhVRfh1TF2k6+ru6TLofvKDiCFnKmtmBENT4RFqIh7Ucgl2OFLfx5AZJKx7d7u0NzS6PcJ8DR/g== X-Google-Smtp-Source: AGHT+IEt+WDn2sNoC5H24Qtd3JA+FbWgV2WhzZ4yhAtuoNg/yOFbP6HXPf0VKOFFZO8syHfT9jYc X-Received: by 2002:a05:6a00:1408:b0:6ea:749c:7849 with SMTP id l8-20020a056a00140800b006ea749c7849mr1387563pfu.13.1714517502447; Tue, 30 Apr 2024 15:51:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714517502; cv=pass; d=google.com; s=arc-20160816; b=l/bFCgMaL5kt9C1ymhqWy9Y+wZK+pyQzrJ4bhZlBI49Ojp5jgVu1b4VoXB2DXP/h2c ysZAmevvzQy3AGy2bpYxKkVq2Tc0kWVZopugs6xPBMXnfNSjtY5IEwNL5/wpARAnfApM E4SeeeyR6507jgNNaN/FwObwE33ujLr+dkq23XjRb879UqCLGQLZctta2IRwFS/10KYB YQaM2oFoHArF6v7+7DDrW8hyMwpEalVgyk5X7W0mi3N9UJm6F8gqGCClrWMeXcgjkldh GYkXNlpQKR2f36BumDJP9zdXUwHVH6JNKYXABOcNv3txMeLwE+AbS1LHZYmhOWjEvDq7 psWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:date:mime-version:list-unsubscribe :list-subscribe:list-id:precedence; bh=QRyMGl5Jg+EmwxIWysTsUoERMtLJpa15UDk5t7wEH1Q=; fh=yMJ8em6h9DeBBp/wCvu1sL74W4Dfz6hkoU9XWswC8R0=; b=BGw626OePzbB0xP5ffCuJJEz54rpYPwKFIoR8QGhocJoWwZSvQe6CxH2vry7AlOohP 9YbONuP7vh/9vJOsOpswK6HzaPgyiSJ4eTxTA9Aqs862pKHXj7fnpI27IhQqPuHxs78G XrmurGeS3qU7wCOCnFfLGLhqvxWqNyQew70JrFngwhGh6PURzOzrXiUydkImsyS6sUXv lz800Of879VJyh+sWmRoejy7Ux6ZftFpUjwvHjciLR6K+rV/pSnts+2RzjlzWUlaQ5ML unlu++REvAWtBv3is+dgCNSZW1lJVwOr1hQa/v9eDMhmy2rJQdusFXnGSF+lbNwmwiG9 w+4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4202-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m4-20020a633f04000000b005f7d5feeec7si20672394pga.750.2024.04.30.15.51.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 15:51:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4202-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 144342826C4 for ; Tue, 30 Apr 2024 22:51:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83A9C38DC3; Tue, 30 Apr 2024 22:51:29 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 857F41EB40 for ; Tue, 30 Apr 2024 22:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714517489; cv=none; b=Pfv1eFWANrq7VlNquttZzPN131f5zX/YZwocmlwtUZI3TXsvkMuhKAjpmC7GUTC/6/HImX9B5cpzk5pMhrQDPMosw57Jb7bYD+bw+i7Ya9fPr1zujVihN5WuF2rw6NOdLeTfsasUt0jqpzNJZ+wUtNJl/rInj0T4mFVTJ+btgGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714517489; c=relaxed/simple; bh=jPBi+DQqltj60QKM7e11ciHdznjGTQILnrk5KJF4avM=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=HWEOEcq6wBSEzosUyWrrJLcBevDrLhM07FUMKNV12RvKPzzVnNrJfYEHDVAeySb8pd5N0I1jo6x+/rOJu2Areb54573rmjrSyI6HfIZ3wTaCmmSM9Q+S7Ie2MZD/xuhWNhFVCvV82nhKHKTY1tMuRoz3KY4Q3ODfDFLA8FjLpcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-7d667dd202cso24049239f.1 for ; Tue, 30 Apr 2024 15:51:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714517486; x=1715122286; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QRyMGl5Jg+EmwxIWysTsUoERMtLJpa15UDk5t7wEH1Q=; b=epuRGnpK6hmflq0cL4SQiG+b8kWpBog5WTY3Y5Os1KmEUATiVE5hhlu7RURbsDbrR5 rH/C9MYZufIoZWSVu4B58/Fd6FjLxYauarXVl8CJRHwWaW4+xl+ikmgkY7LdE61BZxre OYrmMOHPSTbIFXT8qPibV8uT8PETyl9KgcmLLrXWmRW50E7uJwHiwUXsOuIT7vfFWUtJ 3NwqN/W4nJjNdF7U/+oeHhHcAjLVhoUTNsEXbvWt/+q2yX+InmhUpo0zJxmUkye0TAbi a/WFuW/UU5gnHl03CoY+lPe5FMc7oKNMMFqNQWlVTiEezDoN8hlqnd/MW+/vxa74xHRj fU6A== X-Forwarded-Encrypted: i=1; AJvYcCWzuqD8s1j15XEK/Ta/+VtLoC5og8N9vKBWQtqshXiAC62IpM5J1GcFKtuJyc4IYCAAraKKr0PPts46rpEacj20PSJ1cJcUkWm21tvYinhc X-Gm-Message-State: AOJu0YzcF2BhitaeyvNbAdTwE3DL7w1Txp81dXu/HRycdfnoyiDUwLCe yERs6KpRClOM8gh58mvrrbI2GSMaXeYfc8sbX4t4kGF/FuH0ILzic3F/yTQP7YfB3nwUMt4pofm l1ZkGPKOCEa9cFXKj+Ro1SOK1WGs8kD9cMrxbX3GMeXGGNvYUPnIL7BA= Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a5d:850e:0:b0:7d6:f9f:42d0 with SMTP id q14-20020a5d850e000000b007d60f9f42d0mr73972ion.0.1714517486609; Tue, 30 Apr 2024 15:51:26 -0700 (PDT) Date: Tue, 30 Apr 2024 15:51:26 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000c033180617583519@google.com> Subject: [syzbot] [bluetooth?] possible deadlock in hci_dev_close From: syzbot To: johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, luiz.dentz@gmail.com, marcel@holtmann.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Hello, syzbot found the following issue on: HEAD commit: bb7a2467e6be Add linux-next specific files for 20240426 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=17d7d27f180000 kernel config: https://syzkaller.appspot.com/x/.config?x=5c6a0288262dd108 dashboard link: https://syzkaller.appspot.com/bug?extid=27678574afc8747c97f3 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/5175af7dda64/disk-bb7a2467.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/70db0462e868/vmlinux-bb7a2467.xz kernel image: https://storage.googleapis.com/syzbot-assets/3217fb825698/bzImage-bb7a2467.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+27678574afc8747c97f3@syzkaller.appspotmail.com ====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc5-next-20240426-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/20238 is trying to acquire lock: ffff888068f348d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] ffff888068f348d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] ffff888068f348d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: start_flush_work kernel/workqueue.c:4113 [inline] ffff888068f348d0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4172 but task is already holding lock: ffff888068f35060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:559 [inline] ffff888068f35060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_close+0x10a/0x210 net/bluetooth/hci_core.c:586 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&hdev->req_lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hci_cmd_sync_work+0x1ec/0x400 net/bluetooth/hci_sync.c:309 process_one_work kernel/workqueue.c:3222 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3303 worker_thread+0x86d/0xd70 kernel/workqueue.c:3384 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 ((work_completion)(&hdev->cmd_sync_work)){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 touch_work_lockdep_map kernel/workqueue.c:3885 [inline] start_flush_work kernel/workqueue.c:4139 [inline] __flush_work+0x73c/0xd00 kernel/workqueue.c:4172 __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4322 hci_cmd_sync_clear+0x30/0x220 net/bluetooth/hci_sync.c:588 hci_dev_close_sync+0xbae/0x1060 net/bluetooth/hci_sync.c:5188 hci_dev_do_close net/bluetooth/hci_core.c:561 [inline] hci_dev_close+0x112/0x210 net/bluetooth/hci_core.c:586 sock_do_ioctl+0x158/0x460 net/socket.c:1222 sock_ioctl+0x629/0x8e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&hdev->req_lock); lock((work_completion)(&hdev->cmd_sync_work)); lock(&hdev->req_lock); lock((work_completion)(&hdev->cmd_sync_work)); *** DEADLOCK *** 2 locks held by syz-executor.4/20238: #0: ffff888068f35060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:559 [inline] #0: ffff888068f35060 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_close+0x10a/0x210 net/bluetooth/hci_core.c:586 #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: start_flush_work kernel/workqueue.c:4113 [inline] #1: ffffffff8e333ba0 (rcu_read_lock){....}-{1:2}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4172 stack backtrace: CPU: 0 PID: 20238 Comm: syz-executor.4 Not tainted 6.9.0-rc5-next-20240426-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 touch_work_lockdep_map kernel/workqueue.c:3885 [inline] start_flush_work kernel/workqueue.c:4139 [inline] __flush_work+0x73c/0xd00 kernel/workqueue.c:4172 __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4322 hci_cmd_sync_clear+0x30/0x220 net/bluetooth/hci_sync.c:588 hci_dev_close_sync+0xbae/0x1060 net/bluetooth/hci_sync.c:5188 hci_dev_do_close net/bluetooth/hci_core.c:561 [inline] hci_dev_close+0x112/0x210 net/bluetooth/hci_core.c:586 sock_do_ioctl+0x158/0x460 net/socket.c:1222 sock_ioctl+0x629/0x8e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f978a87dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f978b6ad0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f978a9abf80 RCX: 00007f978a87dea9 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 000000000000000a RBP: 00007f978a8ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f978a9abf80 R15: 00007fff06c0ef28 --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup