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 0B3972BB0A for ; Sat, 2 Mar 2024 21:53:57 +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=1709416438; cv=none; b=dqI8jmz9cdaXUOebjIGLA3gkTIbu+guwp4rtrqqB8KuTMIntzoOud1xc3H0amgP8bDyj0onwtZcDM157myjWLNnDzRUxF4r6K3p8+6lcI6LKVMebrvU6JAoouzngh8ze1rF+l0rK7Imgrfv8qkos3QNg2waUnAUFmDxbZ82KerI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709416438; c=relaxed/simple; bh=w1Uldr/yq2QxaLCKo8A4E195uZFVYPN6y2CdxIRxBbs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=s2PsCW9fPst6cphfMjY4HboG8hktwVMRYZU2RR9FsuxZ8UcTc1GaGQ9Waujh/pYvmCFkV7P3Yy87C4Nzz/lqd0Cqfq+nVaNsuwa3xoii0eLB9Z1pk1IUibzu3NrVEYz3qiX93RXbTP8xVWmaPNSSndrBXVac8TfVn909hyak8dQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=t2fxx772; 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="t2fxx772" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13762C433C7; Sat, 2 Mar 2024 21:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709416437; bh=w1Uldr/yq2QxaLCKo8A4E195uZFVYPN6y2CdxIRxBbs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=t2fxx772eX16Jswz1ICUthaHRhJo4HPBgG28S4T5YQ3DL0+cE13CMvRgK0rjmCf4j e9mZch34CsC9IyBbKhLbe99Hi2a6XCfgs9oOh0oYjT14fIzsc13yrVxVp/wfzop8Gf s4NRaQuFuB1j/h4njXFeHpxZvBjehKt5F45Bzh/k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52517: spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain Date: Sat, 2 Mar 2024 22:53:02 +0100 Message-ID: <2024030252-CVE-2023-52517-30dc@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=2672; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=w1Uldr/yq2QxaLCKo8A4E195uZFVYPN6y2CdxIRxBbs=; b=owGbwMvMwCRo6H6F97bub03G02pJDKmP52+xMLOy0Dub8KPOqeXq0qJ4ie5fM0/yfcxp3Fy3Z /8O9vBtHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARy/cM84O/dbndlDUX8zP+ qpv+rvqWpPvxvQzzrBX85sxkYpw6x8rTqdZZ/13aGaZjAA== 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: sun6i: fix race between DMA RX transfer completion and RX FIFO drain Previously the transfer complete IRQ immediately drained to RX FIFO to read any data remaining in FIFO to the RX buffer. This behaviour is correct when dealing with SPI in interrupt mode. However in DMA mode the transfer complete interrupt still fires as soon as all bytes to be transferred have been stored in the FIFO. At that point data in the FIFO still needs to be picked up by the DMA engine. Thus the drain procedure and DMA engine end up racing to read from RX FIFO, corrupting any data read. Additionally the RX buffer pointer is never adjusted according to DMA progress in DMA mode, thus calling the RX FIFO drain procedure in DMA mode is a bug. Fix corruptions in DMA RX mode by draining RX FIFO only in interrupt mode. Also wait for completion of RX DMA when in DMA mode before returning to ensure all data has been copied to the supplied memory buffer. The Linux kernel CVE team has assigned CVE-2023-52517 to this issue. Affected and fixed versions =========================== Fixed in 5.15.134 with commit bd1ec7f9983b Fixed in 6.1.56 with commit 36b29974a7ad Fixed in 6.5.6 with commit 4e149d524678 Fixed in 6.6 with commit 1f11f4202caf Please see https://www.kernel.org or 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-52517 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-sun6i.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/bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f https://git.kernel.org/stable/c/36b29974a7ad2ff604c24ad348f940506c7b1209 https://git.kernel.org/stable/c/4e149d524678431638ff378ef6025e4e89b71097 https://git.kernel.org/stable/c/1f11f4202caf5710204d334fe63392052783876d