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 5F3AB45970 for ; Thu, 4 Apr 2024 08:24:24 +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=1712219065; cv=none; b=jwFv/DAFCDkp4jWIHIcqdcIhZpSxuG0NxMY49KZsEbavs0kx7U0mHgA50Rkicsmv/iR9gR72JrBXXJbQoay7a+l74ivwl88SCTWIQzrsOWv4AfEiHLqOF+Z2ZvHsM3ZIjMfVz/fCtxNKXf4ESWIl7aHwKpcu7w0ZcqeF91zC4Es= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712219065; c=relaxed/simple; bh=afuUbOlUbyKUPz8ZwN87dn2WRmHiwHVy94Z/Fp/icU8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lju8jIwkYzqQ11Vyixj/bLcyAe6BoPBgrpNsAWvUIVMdFvOMXOXdLUkSsehZTjqtRDy4VzYqapMRt64fQzZse1+5PmjggEg/keWF9+v1oWOwCOrRlBYIk4cPdrLdN1X7u7uoJ3NHfXPYVp6eYmO4QMGfiB0W9txvzioeqLExsfc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oxR70BcH; 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="oxR70BcH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62CB1C433F1; Thu, 4 Apr 2024 08:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712219064; bh=afuUbOlUbyKUPz8ZwN87dn2WRmHiwHVy94Z/Fp/icU8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=oxR70BcHK9W/5D2+ilpr9Vf5AEgIQacNVsBbH1EhnXeeGi25uwdEB6BJY/rLPyT7d YWIF6Uvwf0TINaFRtE+72F3GIQ+U0UsW0EnqFbmOBtRUnLOgFO79MRe7T9Rh2nBNdI dUFC1cTBNdJsrtC7pm3HgcU4KgCy+//x0JRzRKsw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26806: spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks Date: Thu, 4 Apr 2024 10:23:23 +0200 Message-ID: <2024040404-CVE-2024-26806-4644@gregkh> X-Mailer: git-send-email 2.44.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=2994; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=afuUbOlUbyKUPz8ZwN87dn2WRmHiwHVy94Z/Fp/icU8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGl8yZlffvNv8LwQFv/JrKzy/Ftl2Q8Jai9V+L67mvLvz v/fZXqwI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACai959hwcSyg8fbri32ljq6 myXsKKebWR3/IoYF0yxK6taEXZns12N9vl965TSG27LZAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: spi: cadence-qspi: remove system-wide suspend helper calls from runtime PM hooks The ->runtime_suspend() and ->runtime_resume() callbacks are not expected to call spi_controller_suspend() and spi_controller_resume(). Remove calls to those in the cadence-qspi driver. Those helpers have two roles currently: - They stop/start the queue, including dealing with the kworker. - They toggle the SPI controller SPI_CONTROLLER_SUSPENDED flag. It requires acquiring ctlr->bus_lock_mutex. Step one is irrelevant because cadence-qspi is not queued. Step two however has two implications: - A deadlock occurs, because ->runtime_resume() is called in a context where the lock is already taken (in the ->exec_op() callback, where the usage count is incremented). - It would disallow all operations once the device is auto-suspended. Here is a brief call tree highlighting the mutex deadlock: spi_mem_exec_op() ... spi_mem_access_start() mutex_lock(&ctlr->bus_lock_mutex) cqspi_exec_mem_op() pm_runtime_resume_and_get() cqspi_resume() spi_controller_resume() mutex_lock(&ctlr->bus_lock_mutex) ... spi_mem_access_end() mutex_unlock(&ctlr->bus_lock_mutex) ... The Linux kernel CVE team has assigned CVE-2024-26806 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 0578a6dbfe75 and fixed in 6.7.9 with commit 041562ebc475 Issue introduced in 6.7 with commit 0578a6dbfe75 and fixed in 6.8 with commit 959043afe53a 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-2024-26806 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: drivers/spi/spi-cadence-quadspi.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/041562ebc4759c9932b59a06527f8753b86da365 https://git.kernel.org/stable/c/959043afe53ae80633e810416cee6076da6e91c6