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 42CBE2C1AC for ; Wed, 28 Feb 2024 08:18:46 +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=1709108326; cv=none; b=F/4bxeHWBYx5sWKI9TADKQQpQw+hbgmiaVyZw2ZvIbrrz9rrMcE8eJot3LryLob6jlyPeHvrA3ikpTod3xbk2RFYKGxpe6hR2IqzWCjWaF6k/mVxKQ1+f2dNfOnNF6ulh4qRpzRuHyipLWkzQtAG8mAry36mIgE+hNBL+XVJlKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709108326; c=relaxed/simple; bh=6SrlBL0jg6XkFCcj8lyy3i7jGVb8mrq3KS83b6A/gWs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZU7hYfLPbhSonQ7Z3V5IdLabf6nBHpBMkLOAW59JBLvSO2svQhNlxsJ+LMt6hYr/LZnb2Ld72+OGzV0zDbtEPMOL96F7z3RWDqVuLYX3GsHJvUuMsknhcjhmDBdIFTb5Y8Z8etRa81evA8ugHFytgohjSDKy8WYDIErm6SyIb/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=W101pRZr; 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="W101pRZr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C708DC433F1; Wed, 28 Feb 2024 08:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709108326; bh=6SrlBL0jg6XkFCcj8lyy3i7jGVb8mrq3KS83b6A/gWs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=W101pRZr53dWSvVKP8rxCJwflFzeJjtiuZ9u5kXP0xSODgfh/V63xqoyOGQq/pHXf LD8bL4vXt3IwWGaK5KWx9IM7SHY2NiZPzEd4bZZG79qx2EDBEpoL/U7Oqc+KObzjqZ wAgorYAv++7pNOJemyV0LYPG7uMJUlBtzBB4LIqI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: gregkh@kernel.org Subject: CVE-2021-47048: spi: spi-zynqmp-gqspi: fix use-after-free in zynqmp_qspi_exec_op Date: Wed, 28 Feb 2024 09:15:36 +0100 Message-ID: <2024022840-CVE-2021-47048-8586@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=2231; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4c6JNnXp4lUn/fH7gGJfq08M1oVpNICf4HlcYX7AhGw=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn3Xhc4un2O98+wf+dx6abvi5Ri1XOSb88eeZpwwnhSS fxMuZWzOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiCQoM8zQ3/H/5yte7/sb5 3AlVDI5TCtxv3WKYK8dyqan5nUlJObvg3D8q0mcnvzxpAgA= 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: fix use-after-free in zynqmp_qspi_exec_op When handling op->addr, it is using the buffer "tmpbuf" which has been freed. This will trigger a use-after-free KASAN warning. Let's use temporary variables to store op->addr.val and op->cmd.opcode to fix this issue. The Linux kernel CVE team has assigned CVE-2021-47048 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.10.37 with commit 1231279389b5 Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.11.21 with commit d67e0d6bd92e Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.12.4 with commit 23269ac9f123 Issue introduced in 5.10 with commit 1c26372e5aa9 and fixed in 5.13 with commit a2c5bedb2d55 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-47048 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/1231279389b5e638bc3b66b9741c94077aed4b5a https://git.kernel.org/stable/c/d67e0d6bd92ebbb0294e7062bbf5cdc773764e62 https://git.kernel.org/stable/c/23269ac9f123eca3aea7682d3345c02e71ed696c https://git.kernel.org/stable/c/a2c5bedb2d55dd27c642c7b9fb6886d7ad7bdb58