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 262C08004F for ; Mon, 29 Jul 2024 15:49:31 +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=1722268172; cv=none; b=j2vZ5EK5UdUfo5frzIdbCwWEFGfuK4bU1lJ6Pxo3iwdwD8JA0rhLyLN3Eqcf+/Oe8VNFUnw++xpkVBgHkVjgpPn2KDYs260ZVpLrV2FFm7E5TxJzLfbAnCOhhVOWZitObYx+NuQAZZp+M3pC4Ns9MDSGZmIw2bHQY/w3OQ2j6sw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722268172; c=relaxed/simple; bh=xE1e9GoixgESqJ+oC3I+dpmIsfDORu75o+eY/1kYTzM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LYhPeR5vvZholOZQu9fbD9nBeRsIiqqNcEODE6gEViSmtQ3zoEWbD5Xqq5MtWwbYlq+SiVgY8x18ykbX3ZaWrr82q+SIJFHBUKFDK1bakSeLemfrz01iCwJ+SZkmAwfqchWUCjfF6NAuK+oztShxZdYIRlbA03Yd5KBR+VqqEAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XdOf97Wc; 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="XdOf97Wc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 506CDC32786; Mon, 29 Jul 2024 15:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722268171; bh=xE1e9GoixgESqJ+oC3I+dpmIsfDORu75o+eY/1kYTzM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XdOf97WcFbVmnFD38Tt1IX5M/FGvlS6f2RMMSqDYXsQeVDgElHSaXFHwLaHbUlr+C MgKcAgH7HAI+6zM8tH/sPfK6a0T+DMMhkUErTbE1O73S2tBlwdc2pW9dR/wQfvlrjf 4fI7Ko1IswqvYXl5LpbhMN0hjUpaBY6oaw5k/JEw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-41088: can: mcp251xfd: fix infinite loop when xmit fails Date: Mon, 29 Jul 2024 17:48:52 +0200 Message-ID: <2024072952-CVE-2024-41088-281e@gregkh> X-Mailer: git-send-email 2.45.2 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=3167; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xE1e9GoixgESqJ+oC3I+dpmIsfDORu75o+eY/1kYTzM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnLdz45Xr9mpvHeVyznBFLsarrFtQ4acxZYZLQEfFBJn 7vyRu3sjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjILWGGBacWzz29kU+z/UCb K9vONpvZCYLJLQzzI/L3HraQ1PEUbylxDt+56pQZC88tAA== 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: can: mcp251xfd: fix infinite loop when xmit fails When the mcp251xfd_start_xmit() function fails, the driver stops processing messages, and the interrupt routine does not return, running indefinitely even after killing the running application. Error messages: [ 441.298819] mcp251xfd spi2.0 can0: ERROR in mcp251xfd_start_xmit: -16 [ 441.306498] mcp251xfd spi2.0 can0: Transmit Event FIFO buffer not empty. (seq=0x000017c7, tef_tail=0x000017cf, tef_head=0x000017d0, tx_head=0x000017d3). ... and repeat forever. The issue can be triggered when multiple devices share the same SPI interface. And there is concurrent access to the bus. The problem occurs because tx_ring->head increments even if mcp251xfd_start_xmit() fails. Consequently, the driver skips one TX package while still expecting a response in mcp251xfd_handle_tefif_one(). Resolve the issue by starting a workqueue to write the tx obj synchronously if err = -EBUSY. In case of another error, decrement tx_ring->head, remove skb from the echo stack, and drop the message. [mkl: use more imperative wording in patch description] The Linux kernel CVE team has assigned CVE-2024-41088 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 55e5b97f003e and fixed in 6.1.97 with commit f926c022ebaa Issue introduced in 5.10 with commit 55e5b97f003e and fixed in 6.6.37 with commit 3e72558c1711 Issue introduced in 5.10 with commit 55e5b97f003e and fixed in 6.9.8 with commit 6c6b4afa59c2 Issue introduced in 5.10 with commit 55e5b97f003e and fixed in 6.10 with commit d8fb63e46c88 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-41088 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/net/can/spi/mcp251xfd/mcp251xfd-core.c drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c drivers/net/can/spi/mcp251xfd/mcp251xfd.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/f926c022ebaabf7963bebf89a97201d66978a025 https://git.kernel.org/stable/c/3e72558c1711d524e3150103739ddd06650e291b https://git.kernel.org/stable/c/6c6b4afa59c2fb4d1759235f866d8caed2aa4729 https://git.kernel.org/stable/c/d8fb63e46c884c898a38f061c2330f7729e75510