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 8B73B218EB7 for ; Thu, 8 May 2025 06:41:26 +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=1746686486; cv=none; b=ZDCi2VwI6bMdumN9HyH2FYX/jTCUa43uOACo4UKmW/coFXo7yFEETaAiXbpiBIulDWZ+ONxVfiHoRtkWKM1IbRwX3bgEAzat8f0zyNXWKNmfFFNnA5/J4YYX9+e3j4XfSqJlR4nCDXGRVEMzX5ISwTeEiVIJ388aQMvcD00Z6sA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746686486; c=relaxed/simple; bh=EO1Rw7qu25DIhLBMilHIBHIHKF7sKGdTKRO91Oq+t5g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ht9HLYDTsHVk74MjLNzgrsJizRAKL1IuBdJefZPOLcT+7x+mBQWu+rPyRVyADV6sMfF14HQ9Pe9SbzLD3dF23CoGrx9SY5jIzPA5n4WyHLPED1s9BEbxZpmbAGV0SH69uC6cxtO3clLn1LQX6PDRjGhVB2T+sUgr8TsyXVMiyLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eq1DWHkb; 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="eq1DWHkb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 084F0C4CEEB; Thu, 8 May 2025 06:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746686486; bh=EO1Rw7qu25DIhLBMilHIBHIHKF7sKGdTKRO91Oq+t5g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=eq1DWHkbZ+QH4Fw/3VKhlKbUwcxLxi4b58CdibiPF9MAjomjM1NYWcMJtJLTnPNEX xj0wmEJ611nlxbUvXRWE1Ql8vbHx67rQAe2k9wFO+l0bQiWl/mpuBf6+o8WuBvlf01 PtyioO4x6eI/WcUOuL9SRJTf9ZXTuo5v6IL+yhk4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37832: cpufreq: sun50i: prevent out-of-bounds access Date: Thu, 8 May 2025 08:39:41 +0200 Message-ID: <2025050824-CVE-2025-37832-e235@gregkh> X-Mailer: git-send-email 2.49.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=2927; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Eyov5uGU2KER0/mfvDoX4PfS50Cka7QtU7KaIscj6Gg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkygXOYd4e+lF7aK9P7JlGFU6rPsOhplFnx/rhi7hv32 fe/r5vWEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNRfMiw4LJNbvo5F44Lkp1/ fslKbFqop+4ozDBPzyreo6msg32Pz/Mb6W/sVtc+sLMDAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: cpufreq: sun50i: prevent out-of-bounds access A KASAN enabled kernel reports an out-of-bounds access when handling the nvmem cell in the sun50i cpufreq driver: ================================================================== BUG: KASAN: slab-out-of-bounds in sun50i_cpufreq_nvmem_probe+0x180/0x3d4 Read of size 4 at addr ffff000006bf31e0 by task kworker/u16:1/38 This is because the DT specifies the nvmem cell as covering only two bytes, but we use a u32 pointer to read the value. DTs for other SoCs indeed specify 4 bytes, so we cannot just shorten the variable to a u16. Fortunately nvmem_cell_read() allows to return the length of the nvmem cell, in bytes, so we can use that information to only access the valid portion of the data. To cover multiple cell sizes, use memcpy() to copy the information into a zeroed u32 buffer, then also make sure we always read the data in little endian fashion, as this is how the data is stored in the SID efuses. The Linux kernel CVE team has assigned CVE-2025-37832 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 6cc4bcceff9af0e6be9738096d95e4ba75e75123 and fixed in 6.12.26 with commit 40bf7f560ca4c2468d518cebf14561bc864f58f8 Issue introduced in 6.10 with commit 6cc4bcceff9af0e6be9738096d95e4ba75e75123 and fixed in 6.14.5 with commit dba5a1f963cf781c0b60f4b7f07465a6c687c27e Issue introduced in 6.10 with commit 6cc4bcceff9af0e6be9738096d95e4ba75e75123 and fixed in 6.15-rc4 with commit 14c8a418159e541d70dbf8fc71225d1623beaf0f 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-2025-37832 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/cpufreq/sun50i-cpufreq-nvmem.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/40bf7f560ca4c2468d518cebf14561bc864f58f8 https://git.kernel.org/stable/c/dba5a1f963cf781c0b60f4b7f07465a6c687c27e https://git.kernel.org/stable/c/14c8a418159e541d70dbf8fc71225d1623beaf0f