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 2E97D12E1DC for ; Mon, 8 Dec 2025 01:17:25 +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=1765156646; cv=none; b=sb+SKdQrv7i7jo0jtMHtFZQtYRdYw383ubsw5/IduqiRsICIC4JEIRU2uYgFvudTKbvMGO6wOAfN4o6KrbUisCxFn0W3qUxHpCdzdkdlHc/kpvuefo4k+WKLa26XmZx7xYKdNwWdZUkqGEwE/HfGDH5ZXvk/q7zahgrgJODcDXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765156646; c=relaxed/simple; bh=rnc2494KKZuERSBtbCZTgYRQS8QM6vCAOUuC+NVA9DE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GuqHc/hajy03V+byaXWKwKQbQPeiKZWsLotMjYlhhyAjo4mzxId8b1rV1nk6bbF1xR98y7VfmAsZS50DJ8938ERSK5wR6cogBczm1qBiAUqJiESSdac98fV9NH8xb+1dTdd7SaVcKlfpOSvpxre34TlI8K//mCnTsRxnzIH0/NM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nypfTP+Z; 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="nypfTP+Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37EB6C4CEFB; Mon, 8 Dec 2025 01:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765156645; bh=rnc2494KKZuERSBtbCZTgYRQS8QM6vCAOUuC+NVA9DE=; h=From:To:Cc:Subject:Date:Reply-To:From; b=nypfTP+ZsnvDfwq9tN5LgZtH9364zo2uh8Qk/nyesGYDrM2/mn8c2D94aJXu962w3 XKmaWR12tWIyODQXVKNMJZ1YFD0O05tWKI4/3ng5l27MzSkL2W9L6XMw3mvEkBpaXO paIi+7D1bs0gaTg2tRMliQ1XsT4Grij/KtxrEmlM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50616: regulator: core: Use different devices for resource allocation and DT lookup Date: Mon, 8 Dec 2025 10:16:53 +0900 Message-ID: <2025120851-CVE-2022-50616-bef8@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3148; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=o0aU6ya4f+gw2W0XKjKfiStLNaqByPwf2zSpBQziEko=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlm6szmrvOV7pqvWiCz1DA79NjCft+uXYs0c8RlXdXnv PvOprW9I4aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACayX5NhwZyzwWLv1uhfP/71 TKO3Q9JDkZ7KWQwzdt9nWaBs/T8pPujW3SvS5+6cyHMBAA== 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: core: Use different devices for resource allocation and DT lookup Following by the below discussion, there's the potential UAF issue between regulator and mfd. https://lore.kernel.org/all/20221128143601.1698148-1-yangyingliang@huawei.com/ >From the analysis of Yingliang CPU A |CPU B mt6370_probe() | devm_mfd_add_devices() | |mt6370_regulator_probe() | regulator_register() | //allocate init_data and add it to devres | regulator_of_get_init_data() i2c_unregister_device() | device_del() | devres_release_all() | // init_data is freed | release_nodes() | | // using init_data causes UAF | regulator_register() It's common to use mfd core to create child device for the regulator. In order to do the DT lookup for init data, the child that registered the regulator would pass its parent as the parameter. And this causes init data resource allocated to its parent, not itself. The issue happen when parent device is going to release and regulator core is still doing some operation of init data constraint for the regulator of child device. To fix it, this patch expand 'regulator_register' API to use the different devices for init data allocation and DT lookup. The Linux kernel CVE team has assigned CVE-2022-50616 to this issue. Affected and fixed versions =========================== Fixed in 6.0.16 with commit cb29811d989bcb7ea81ca111c4b13878b344e086 Fixed in 6.1.2 with commit b0f25ca1ff9be7abd1679ae7e59a8f25dbffe67a Fixed in 6.2 with commit 8f3cbcd6b440032ebc7f7d48a1689dcc70a4eb98 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-2022-50616 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/platform/x86/intel/int3472/clk_and_regulator.c drivers/regulator/core.c drivers/regulator/devres.c drivers/regulator/of_regulator.c drivers/regulator/stm32-vrefbuf.c include/linux/regulator/driver.h 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/cb29811d989bcb7ea81ca111c4b13878b344e086 https://git.kernel.org/stable/c/b0f25ca1ff9be7abd1679ae7e59a8f25dbffe67a https://git.kernel.org/stable/c/8f3cbcd6b440032ebc7f7d48a1689dcc70a4eb98