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 EC48278C8D for ; Wed, 22 May 2024 06:24:00 +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=1716359041; cv=none; b=dFGnr3PW3ImKHZrfkAWx412AOo3aQozVc5pD9+e9BNBmJi/1wo9d5wfPI+hp9A3cTKRn7cwIpmj5p7KQ41lISPSBpOp9RGcj/qj/wTS0KPbK9f3cEWR7/km+REozAYl2xj+WX9EAVns5cRSGEjYTxS6okErWP/+Yv03nb63608A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716359041; c=relaxed/simple; bh=zzNC2fKC3HxuHlwlMEN9j4OyptQbKLrPX5ikvptp464=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=beLs9NJrYhrg+br8bdYTFbHEUokaIfqsWMWCuaCXUdwcxyA/1I1utqWdLa5RvWGjUpjYoGfOnxYjZMPxF7UzzlVWquCuT8stlP8AnpJD9JKJuWdjKFml/xLJiW5CarubnaPAZAA4SLbcruGV10nRaMn06CWcy10x54u5G3BBBuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hgatZ00s; 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="hgatZ00s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3159AC2BD11; Wed, 22 May 2024 06:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716359040; bh=zzNC2fKC3HxuHlwlMEN9j4OyptQbKLrPX5ikvptp464=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hgatZ00s6LGjoQDegm3+vUxuvY88G4AO9qrchxPzcHBDA2mC83srgAj3sDKndrhG9 VtaRCZ14S6GUib200QuBf+x5mE0+KfEsHlDsaDuTkMwjb7rZh6POF3Z8Ip2SWJJHUw 03Xdnxhide+8SDOsr947Xl0rW8jaAnM2rcEsoDO4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47469: spi: Fix deadlock when adding SPI controllers on SPI buses Date: Wed, 22 May 2024 08:23:35 +0200 Message-ID: <2024052227-CVE-2021-47469-00c0@gregkh> X-Mailer: git-send-email 2.45.1 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=2221; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=zzNC2fKC3HxuHlwlMEN9j4OyptQbKLrPX5ikvptp464=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm+/Qmz1XY4bX9QcGD5znSP8826ITxvnMvfdFsovv27s l5/icPfjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIiRDDPBPNr2ekXxsvXLKb t+BEtYmw1enqdQyz2UNNZrwue3n4vtJC0bbLs8un6kQ/BgA= 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: Fix deadlock when adding SPI controllers on SPI buses Currently we have a global spi_add_lock which we take when adding new devices so that we can check that we're not trying to reuse a chip select that's already controlled. This means that if the SPI device is itself a SPI controller and triggers the instantiation of further SPI devices we trigger a deadlock as we try to register and instantiate those devices while in the process of doing so for the parent controller and hence already holding the global spi_add_lock. Since we only care about concurrency within a single SPI bus move the lock to be per controller, avoiding the deadlock. This can be easily triggered in the case of spi-mux. The Linux kernel CVE team has assigned CVE-2021-47469 to this issue. Affected and fixed versions =========================== Fixed in 5.14.15 with commit 722ef19a161c Fixed in 5.15 with commit 6098475d4cb4 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-2021-47469 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.c include/linux/spi/spi.h 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/722ef19a161ce3fffb3d1b01ce2301c306639bdd https://git.kernel.org/stable/c/6098475d4cb48d821bdf453c61118c56e26294f0