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 7D38B2C1AD for ; Wed, 28 Feb 2024 08:18:11 +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=1709108291; cv=none; b=SV+dFS7d35h3Wa5Rpw5oMU1K8E4KeXorXrvV48rM9MelcG9esl6FsEs1rfts26tPdrxkStsAbEWxa6dLpTFUN9rI9oneTcptgNE48HcGJ5PV4Q/Qn/zcj1pfFd55Eq0vfczl+K0fnOH9JqkJi1Vk7WYR2GFVUrS4ldaI6KWn3Ek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709108291; c=relaxed/simple; bh=VySzwAM0DnlvX7DbZkDJFJiYT5mYbacHvjHlRWiaPsM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=i/2jkRh1OeGye/KTXUDM6AncFgCW+SxzwVYD71zQESxe36prH3+x+bcYEInTFKyCk4Dzj9QQY7tWCZdggkxfrO8NOaMwDs/t5YvCXMlLyQw3MNeI/ik5gHV8SU2xUhDro3NPz9mXxPBjD2CjRRleQgrQtdzQ/rw58FghQ9lrqN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jbmGyE/y; 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="jbmGyE/y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FF3FC433C7; Wed, 28 Feb 2024 08:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709108291; bh=VySzwAM0DnlvX7DbZkDJFJiYT5mYbacHvjHlRWiaPsM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jbmGyE/yb4aeTZktgOCf0FxFsV1E3NJf0Bce/1ZGtu/m5e8YKdY7qMJaHFeECCNj2 qYpObW9HOXN123rwCNathC/CY7erkKOY6y4dyF0/uEERrMR8E5CcfkO9jZMJYcl1tu LXyH+bsQ5CFU8EqAOjhn8aeIIRT9Dek4x+gmoNdw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: gregkh@kernel.org Subject: CVE-2021-47047: spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails Date: Wed, 28 Feb 2024 09:15:35 +0100 Message-ID: <2024022839-CVE-2021-47047-4c75@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=3209; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=84sz3vIFYFCXO7ZRTy+xJv1yQPFrw5n2e1foUBJrW10=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn3XufP6vWoPe13eNaiCdf6w07fFnO6sKde6bCn7vPpS +e+YrCw74hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJ2D5nmKeo/vkP38OSZ+GL VzFwLfR8qHFJwYJhfviCZm+tnj2fGS0rpj+InRzB++dEJAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: gregkh@kernel.org Description =========== In the Linux kernel, the following vulnerability has been resolved: spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails The spi controller supports 44-bit address space on AXI in DMA mode, so set dma_addr_t width to 44-bit to avoid using a swiotlb mapping. In addition, if dma_map_single fails, it should return immediately instead of continuing doing the DMA operation which bases on invalid address. This fixes the following crash which occurs in reading a big block from flash: [ 123.633577] zynqmp-qspi ff0f0000.spi: swiotlb buffer is full (sz: 4194304 bytes), total 32768 (slots), used 0 (slots) [ 123.644230] zynqmp-qspi ff0f0000.spi: ERR:rxdma:memory not mapped [ 123.784625] Unable to handle kernel paging request at virtual address 00000000003fffc0 [ 123.792536] Mem abort info: [ 123.795313] ESR = 0x96000145 [ 123.798351] EC = 0x25: DABT (current EL), IL = 32 bits [ 123.803655] SET = 0, FnV = 0 [ 123.806693] EA = 0, S1PTW = 0 [ 123.809818] Data abort info: [ 123.812683] ISV = 0, ISS = 0x00000145 [ 123.816503] CM = 1, WnR = 1 [ 123.819455] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000805047000 [ 123.825887] [00000000003fffc0] pgd=0000000803b45003, p4d=0000000803b45003, pud=0000000000000000 [ 123.834586] Internal error: Oops: 96000145 [#1] PREEMPT SMP The Linux kernel CVE team has assigned CVE-2021-47047 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.10.37 with commit 5980a3b9c933 Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.11.21 with commit c26c026eb496 Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.12.4 with commit bad5a23cf2b4 Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.13 with commit 126bdb606fd2 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-2021-47047 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-zynqmp-gqspi.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/5980a3b9c933408bc22b0e349b78c3ebd7cbf880 https://git.kernel.org/stable/c/c26c026eb496261dbc0adbf606cc81989cd2038c https://git.kernel.org/stable/c/bad5a23cf2b477fa78b85fd392736dae09a1e818 https://git.kernel.org/stable/c/126bdb606fd2802454e6048caef1be3e25dd121e