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 7422C10A03 for ; Wed, 19 Jun 2024 14:54: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=1718808887; cv=none; b=HDqGihWL8hQRg4R1jZzsAeV+QLJHwjhasoCxTbkpEHK5e4TSpQ2Rx1Mct5HplIhwwhycamitgcqCPwfzcJh0QoAUw5pdVLoK0gL83iv1WX91+XLg8SmdcLdO775L3GrlY/RcGGB5jugV/9lXiCr4ZJT95M9OgDulzfCRs/LDxkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718808887; c=relaxed/simple; bh=DJf0T70JcCaHBkLJMNPQmrsKbMuxu2Os0IgsLLLX9MM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Zzl1uJ1rT6tfnblq1HGJXHJCjJeT89gcbaqH64wWykjSSum3Vji+jmKS6BPeFiIR64GesUHq3qhiJi6ByjND7WxBgDLdWkKMf94P9Lx/KzyrwhI8LfoUDNpTa6uU/PHsxQ5HOLqAN02K8Bp9m3oK7hZwLnCJXQX2W8FqiS3yvj8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2bgQtvv2; 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="2bgQtvv2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BBCFC32786; Wed, 19 Jun 2024 14:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718808885; bh=DJf0T70JcCaHBkLJMNPQmrsKbMuxu2Os0IgsLLLX9MM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=2bgQtvv2Ix8fp4hilC3HdRzftwQTSQungxsj4V3XtgWZ3hHW6p9IxBvqdo1aULYSo qPwf5/PndARTGHOKOwrA4G1R3GaOJtVZjuSWy8EpmZqAuhzdE9E5lZkvOW1a6z344c E1cdp/AOBa8V8iHI8nQX6WoWCjmw1uXQgnTGkVW8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47586: net: stmmac: dwmac-rk: fix oob read in rk_gmac_setup Date: Wed, 19 Jun 2024 16:54:25 +0200 Message-ID: <2024061917-CVE-2021-47586-69ce@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=2174; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=DJf0T70JcCaHBkLJMNPQmrsKbMuxu2Os0IgsLLLX9MM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlFHyVlTqeH3ub48X23b/lxX+ls8x2zrPkv+F5c/unOA zbm36lnO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAihxsZ5un8i7NzOftgno7m rLq8gq3T9jufzmWY75T+ld/L54nnp7hgQUsdHZmrz4/cAwA= 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: net: stmmac: dwmac-rk: fix oob read in rk_gmac_setup KASAN reports an out-of-bounds read in rk_gmac_setup on the line: while (ops->regs[i]) { This happens for most platforms since the regs flexible array member is empty, so the memory after the ops structure is being read here. It seems that mostly this happens to contain zero anyway, so we get lucky and everything still works. To avoid adding redundant data to nearly all the ops structures, add a new flag to indicate whether the regs field is valid and avoid this loop when it is not. The Linux kernel CVE team has assigned CVE-2021-47586 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 3bb3d6b1c195 and fixed in 5.15.11 with commit 0b4a5d1e15ce Issue introduced in 5.14 with commit 3bb3d6b1c195 and fixed in 5.16 with commit 0546b224cc77 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-47586 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/ethernet/stmicro/stmmac/dwmac-rk.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/0b4a5d1e15ce72f69be48f38dc0401dab890ae0f https://git.kernel.org/stable/c/0546b224cc7717cc8a2db076b0bb069a9c430794