Linux: regulator: tps6594: Fix device node reference leaks in multiphase loop
What fixes it
- 28f70e0aa767a8f022c70ed75ecef227dc668121LinuxCVE List
- 4a672bff99f6b58dde419fd12b3a53da137f032dLinuxCVE List
- 68ce4f8223b78f8616ec7f4a02c38988eae627d2LinuxCVE List
- 7fd28093b3effc4f92566466df364622830ec608LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
regulator: tps6594: Fix device node reference leaks in multiphase loop
In tps6594_regulator_probe(), the multi-phase configuration loop calls of_find_node_by_name() to find buck nodes by name, and of_get_parent() twice to navigate to the PMIC parent node. None of the acquired node references (np, intermediate parent, np_pmic_parent) are ever released via of_node_put(), causing a reference leak on every loop iteration.
Additionally, of_find_node_by_name() can return NULL, but the result was immediately passed to of_node_full_name() and of_get_parent() without a NULL check, which could lead to a NULL pointer dereference.
Fix this by:
- Adding a NULL check for np after of_find_node_by_name()
- Storing the intermediate parent node in a local variable np_parent
- Calling of_node_put() on np, np_parent and np_pmic_parent at the
end of each loop iteration
Text from CVE List
Affected versions 12
- Linuxaffected: f17ccc5deb4d024bb52fd3433471e77ab7ae9ad8 before 28f70e0aa767a8f022c70ed75ecef227dc668121CVE List
- Linuxaffected: f17ccc5deb4d024bb52fd3433471e77ab7ae9ad8 before 4a672bff99f6b58dde419fd12b3a53da137f032dCVE List
- Linuxaffected: f17ccc5deb4d024bb52fd3433471e77ab7ae9ad8 before 68ce4f8223b78f8616ec7f4a02c38988eae627d2CVE List
- Linuxaffected: f17ccc5deb4d024bb52fd3433471e77ab7ae9ad8 before fceac25487b21d6db940d2aed368e465d89cd1f4CVE List
- Linuxaffected: f17ccc5deb4d024bb52fd3433471e77ab7ae9ad8 before 7fd28093b3effc4f92566466df364622830ec608CVE List
- Linuxaffected: 6.5CVE List
- Linuxunaffected: all versions before 6.5CVE List
- Linuxunaffected: 6.6.157 through 6.6.*CVE List
- Linuxunaffected: 6.12.110 through 6.12.*CVE List
- Linuxunaffected: 6.18.52 through 6.18.*CVE List
- Linuxunaffected: 7.2.6 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 5
- git.kernel.org/stable/c/28f70e0aa767a8f022c70ed75ecef227dc668121Referencevia CVE List
- git.kernel.org/stable/c/4a672bff99f6b58dde419fd12b3a53da137f032dReferencevia CVE List
- git.kernel.org/stable/c/68ce4f8223b78f8616ec7f4a02c38988eae627d2Referencevia CVE List
- git.kernel.org/stable/c/fceac25487b21d6db940d2aed368e465d89cd1f4Referencevia CVE List
- git.kernel.org/stable/c/7fd28093b3effc4f92566466df364622830ec608Referencevia CVE List