Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B93713009CE for ; Mon, 15 Sep 2025 14:26:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757946368; cv=none; b=TntGDFyKwVL53WD0S5Wyjb55q+ifBaEv5Bq5jwEQ8QxaWD1NWdugqolWB21cWC83V/l3HEjUvlocroBCowfH+26YBZiqL7d4HKCLcJa6S2GnEnp6rw46j/SZI6nJUVMG3QeqGDLgEOaAHOtKo0CvXry254mLdH8KikLXWW6Ox8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757946368; c=relaxed/simple; bh=r5vjNph/KstaaHUrf4Sy2c7b6aA4cip/sidlHhF4EGQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gLHpPXVTgOXF81X7Rb2MpjDU5qscz20sL847/s+8IP+1vXsD9us75zboCJJT2fznuc22fI+XO7fQiiLzhJmQ27IRXf4yS6Gs0sED8FGajqMy3XFvHmc2izTYtJh23BAsgzk2tDCHzGw5ALhx5oGKQGrdDqFfS/axYW2GzOjXT3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uHjhaG9+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uHjhaG9+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 220BEC4CEF7; Mon, 15 Sep 2025 14:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757946368; bh=r5vjNph/KstaaHUrf4Sy2c7b6aA4cip/sidlHhF4EGQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=uHjhaG9+WjdKtwi257K5oTYDbNGLdUnEdf9efIOmlz2WGNKxnOq0VxHloDwb50Kd5 Nij9/RpK3E8bKP5m71pvjg5OKFcpQVcjtHykq+wV61bEunlR9QR9OnupS2BNcT86MV V3CF7Fleg+mGTZSmHPoSwHljbdjRRGUvMdJBpCjE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53233: net/smc: fix deadlock triggered by cancel_delayed_work_syn() Date: Mon, 15 Sep 2025 16:22:07 +0200 Message-ID: <2025091515-CVE-2023-53233-8c6b@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=7771; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=YA5ScHoy5TxvlAiWlIIoQOrwdl3noowc4Vf6UEI9JuE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknFG7nrqye+TKT5U8tb2SYT/ObZ3ffn7j8ZH77stkPm 8zvlWq874hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJ8B1nmJ/tuKCfxTOUf0tE cPm2mFW+Z/9V7GSYX6u5b7H2wc0Tpj/sOPbNJ3LtoxzJLQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net/smc: fix deadlock triggered by cancel_delayed_work_syn() The following LOCKDEP was detected: Workqueue: events smc_lgr_free_work [smc] WARNING: possible circular locking dependency detected 6.1.0-20221027.rc2.git8.56bc5b569087.300.fc36.s390x+debug #1 Not tainted ------------------------------------------------------ kworker/3:0/176251 is trying to acquire lock: 00000000f1467148 ((wq_completion)smc_tx_wq-00000000#2){+.+.}-{0:0}, at: __flush_workqueue+0x7a/0x4f0 but task is already holding lock: 0000037fffe97dc8 ((work_completion)(&(&lgr->free_work)->work)){+.+.}-{0:0}, at: process_one_work+0x232/0x730 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 ((work_completion)(&(&lgr->free_work)->work)){+.+.}-{0:0}: __lock_acquire+0x58e/0xbd8 lock_acquire.part.0+0xe2/0x248 lock_acquire+0xac/0x1c8 __flush_work+0x76/0xf0 __cancel_work_timer+0x170/0x220 __smc_lgr_terminate.part.0+0x34/0x1c0 [smc] smc_connect_rdma+0x15e/0x418 [smc] __smc_connect+0x234/0x480 [smc] smc_connect+0x1d6/0x230 [smc] __sys_connect+0x90/0xc0 __do_sys_socketcall+0x186/0x370 __do_syscall+0x1da/0x208 system_call+0x82/0xb0 -> #3 (smc_client_lgr_pending){+.+.}-{3:3}: __lock_acquire+0x58e/0xbd8 lock_acquire.part.0+0xe2/0x248 lock_acquire+0xac/0x1c8 __mutex_lock+0x96/0x8e8 mutex_lock_nested+0x32/0x40 smc_connect_rdma+0xa4/0x418 [smc] __smc_connect+0x234/0x480 [smc] smc_connect+0x1d6/0x230 [smc] __sys_connect+0x90/0xc0 __do_sys_socketcall+0x186/0x370 __do_syscall+0x1da/0x208 system_call+0x82/0xb0 -> #2 (sk_lock-AF_SMC){+.+.}-{0:0}: __lock_acquire+0x58e/0xbd8 lock_acquire.part.0+0xe2/0x248 lock_acquire+0xac/0x1c8 lock_sock_nested+0x46/0xa8 smc_tx_work+0x34/0x50 [smc] process_one_work+0x30c/0x730 worker_thread+0x62/0x420 kthread+0x138/0x150 __ret_from_fork+0x3c/0x58 ret_from_fork+0xa/0x40 -> #1 ((work_completion)(&(&smc->conn.tx_work)->work)){+.+.}-{0:0}: __lock_acquire+0x58e/0xbd8 lock_acquire.part.0+0xe2/0x248 lock_acquire+0xac/0x1c8 process_one_work+0x2bc/0x730 worker_thread+0x62/0x420 kthread+0x138/0x150 __ret_from_fork+0x3c/0x58 ret_from_fork+0xa/0x40 -> #0 ((wq_completion)smc_tx_wq-00000000#2){+.+.}-{0:0}: check_prev_add+0xd8/0xe88 validate_chain+0x70c/0xb20 __lock_acquire+0x58e/0xbd8 lock_acquire.part.0+0xe2/0x248 lock_acquire+0xac/0x1c8 __flush_workqueue+0xaa/0x4f0 drain_workqueue+0xaa/0x158 destroy_workqueue+0x44/0x2d8 smc_lgr_free+0x9e/0xf8 [smc] process_one_work+0x30c/0x730 worker_thread+0x62/0x420 kthread+0x138/0x150 __ret_from_fork+0x3c/0x58 ret_from_fork+0xa/0x40 other info that might help us debug this: Chain exists of: (wq_completion)smc_tx_wq-00000000#2 --> smc_client_lgr_pending --> (work_completion)(&(&lgr->free_work)->work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&(&lgr->free_work)->work)); lock(smc_client_lgr_pending); lock((work_completion) (&(&lgr->free_work)->work)); lock((wq_completion)smc_tx_wq-00000000#2); *** DEADLOCK *** 2 locks held by kworker/3:0/176251: #0: 0000000080183548 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x232/0x730 #1: 0000037fffe97dc8 ((work_completion) (&(&lgr->free_work)->work)){+.+.}-{0:0}, at: process_one_work+0x232/0x730 stack backtrace: CPU: 3 PID: 176251 Comm: kworker/3:0 Not tainted Hardware name: IBM 8561 T01 701 (z/VM 7.2.0) Call Trace: [<000000002983c3e4>] dump_stack_lvl+0xac/0x100 [<0000000028b477ae>] check_noncircular+0x13e/0x160 [<0000000028b48808>] check_prev_add+0xd8/0xe88 [<0000000028b49cc4>] validate_chain+0x70c/0xb20 [<0000000028b4bd26>] __lock_acquire+0x58e/0xbd8 [<0000000028b4cf6a>] lock_acquire.part.0+0xe2/0x248 [<0000000028b4d17c>] lock_acquire+0xac/0x1c8 [<0000000028addaaa>] __flush_workqueue+0xaa/0x4f0 [<0000000028addf9a>] drain_workqueue+0xaa/0x158 [<0000000028ae303c>] destroy_workqueue+0x44/0x2d8 [<000003ff8029af26>] smc_lgr_free+0x9e/0xf8 [smc] [<0000000028adf3d4>] process_one_work+0x30c/0x730 [<0000000028adf85a>] worker_thread+0x62/0x420 [<0000000028aeac50>] kthread+0x138/0x150 [<0000000028a63914>] __ret_from_fork+0x3c/0x58 [<00000000298503da>] ret_from_fork+0xa/0x40 INFO: lockdep is turned off. =================================================================== This deadlock occurs because cancel_delayed_work_sync() waits for the work(&lgr->free_work) to finish, while the &lgr->free_work waits for the work(lgr->tx_wq), which needs the sk_lock-AF_SMC, that is already used under the mutex_lock. The solution is to use cancel_delayed_work() instead, which kills off a pending work. The Linux kernel CVE team has assigned CVE-2023-53233 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit a52bcc919b14c9d78f03b2b4ff604e5ca69c7e6d and fixed in 5.10.176 with commit 9708efad9ba5095b9bb7916e11a135b3bd66c071 Issue introduced in 5.8 with commit a52bcc919b14c9d78f03b2b4ff604e5ca69c7e6d and fixed in 5.15.104 with commit b615238e5bc01e13dc0610febddc1ca99bab1df6 Issue introduced in 5.8 with commit a52bcc919b14c9d78f03b2b4ff604e5ca69c7e6d and fixed in 6.1.21 with commit 3517584cf1b35bd02f4a90267ddf9dcf17bd9c87 Issue introduced in 5.8 with commit a52bcc919b14c9d78f03b2b4ff604e5ca69c7e6d and fixed in 6.2.8 with commit c9ca2257150272df1b8d9ebe5059197ffea6e913 Issue introduced in 5.8 with commit a52bcc919b14c9d78f03b2b4ff604e5ca69c7e6d and fixed in 6.3 with commit 13085e1b5cab8ad802904d72e6a6dae85ae0cd20 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-53233 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/smc/smc_core.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/9708efad9ba5095b9bb7916e11a135b3bd66c071 https://git.kernel.org/stable/c/b615238e5bc01e13dc0610febddc1ca99bab1df6 https://git.kernel.org/stable/c/3517584cf1b35bd02f4a90267ddf9dcf17bd9c87 https://git.kernel.org/stable/c/c9ca2257150272df1b8d9ebe5059197ffea6e913 https://git.kernel.org/stable/c/13085e1b5cab8ad802904d72e6a6dae85ae0cd20