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 C0CC7285060 for ; Wed, 18 Jun 2025 09:29:44 +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=1750238985; cv=none; b=S4yxnKdoPYftNV2x0tHS3ayFmlQDmg83lhSG60vBSMskMTyM1icksMs8+b44DdQcSTI7bwv5DSYt18SbGYcx5N4+xNQBsBx7oslcFfxKsl8akFPawcGnsB3LSMnM3uAxm0I1bjWPo68DB3dCJ6iYnSvtoaVqdYzIE7kOnTJ/lCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750238985; c=relaxed/simple; bh=sFv//ncEaU4pAaEqySzcuursZheHuRmzl2adG9A4WrQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ua1r4WIOugHK8RK/cFaU6if7Q3h4Pm06Wf+mo31Gh4lrocD2WXAQWUXYfgaho4yFy/k7xKhwG8+6lg5s2y+tKEXsXW19DZS1RFKp+BxhOinauQ5tf5/yPqscEyUjrqdVMGrsCUrgBmv0luGHRPF4sVO9n1XfwpS6C9jiCDejpds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Lr1f9tJP; 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="Lr1f9tJP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B99C4CEED; Wed, 18 Jun 2025 09:29:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750238984; bh=sFv//ncEaU4pAaEqySzcuursZheHuRmzl2adG9A4WrQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Lr1f9tJP/7YImIUOYJbWS1ZxWDOXwEt2fq+JWXhW/pu5JnOKby8PoY6YIeuEcoU0p iBZAD2FdqRnWNA4VoHepFjfXpkz6ChB/IYPWKojeMG6bBEUGgcsjCOfrbOOxf/LnxJ HbqX9Z+Uy8b8K6Fy23zO2ov+H3RhYZXhmQuFy4c0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38027: regulator: max20086: fix invalid memory access Date: Wed, 18 Jun 2025 11:29:01 +0200 Message-ID: <2025061848-CVE-2025-38027-3bca@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=3582; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ft7Szit/T9VG3kerbjOWHhQr6m2pKzGoiF4ld8omk+U=; b=kA0DAAIRMUfUDdst+ykByyZiAGhShtCjPqOl+fkwSQiBWv1g14ke9ZuycLjQoALI+/kvRQPib IhdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmhShtAACgkQMUfUDdst+ykgugCgzIKS jqyFUFvHCAEzkHX3FYemR4oAn3t/wRRnd4MztDMUmE9WYVKWXW5l 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: regulator: max20086: fix invalid memory access max20086_parse_regulators_dt() calls of_regulator_match() using an array of struct of_regulator_match allocated on the stack for the matches argument. of_regulator_match() calls devm_of_regulator_put_matches(), which calls devres_alloc() to allocate a struct devm_of_regulator_matches which will be de-allocated using devm_of_regulator_put_matches(). struct devm_of_regulator_matches is populated with the stack allocated matches array. If the device fails to probe, devm_of_regulator_put_matches() will be called and will try to call of_node_put() on that stack pointer, generating the following dmesg entries: max20086 6-0028: Failed to read DEVICE_ID reg: -121 kobject: '\xc0$\xa5\x03' (000000002cebcb7a): is not initialized, yet kobject_put() is being called. Followed by a stack trace matching the call flow described above. Switch to allocating the matches array using devm_kcalloc() to avoid accessing the stack pointer long after it's out of scope. This also has the advantage of allowing multiple max20086 to probe without overriding the data stored inside the global of_regulator_match. The Linux kernel CVE team has assigned CVE-2025-38027 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit bfff546aae50ae68ed395bf0e0848188d27b0ba3 and fixed in 6.1.140 with commit 6ba30f7aa2c550b2ac04f16b81a19a8c045b8660 Issue introduced in 5.17 with commit bfff546aae50ae68ed395bf0e0848188d27b0ba3 and fixed in 6.6.92 with commit 7bddac8603d4e396872c2fbf4403ec08e7b1d7c8 Issue introduced in 5.17 with commit bfff546aae50ae68ed395bf0e0848188d27b0ba3 and fixed in 6.12.30 with commit d2a9a92bb4cc7568cff68241b0051dc7268bdc68 Issue introduced in 5.17 with commit bfff546aae50ae68ed395bf0e0848188d27b0ba3 and fixed in 6.14.8 with commit 5578ab04bd7732f470fc614bbc0a924900399fb8 Issue introduced in 5.17 with commit bfff546aae50ae68ed395bf0e0848188d27b0ba3 and fixed in 6.15 with commit 6b0cd72757c69bc2d45da42b41023e288d02e772 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-38027 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/regulator/max20086-regulator.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/6ba30f7aa2c550b2ac04f16b81a19a8c045b8660 https://git.kernel.org/stable/c/7bddac8603d4e396872c2fbf4403ec08e7b1d7c8 https://git.kernel.org/stable/c/d2a9a92bb4cc7568cff68241b0051dc7268bdc68 https://git.kernel.org/stable/c/5578ab04bd7732f470fc614bbc0a924900399fb8 https://git.kernel.org/stable/c/6b0cd72757c69bc2d45da42b41023e288d02e772