pinctrl: devicetree: don't free uninitialized dev_name on error path
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 4.5, 4.10, 4.15, 4.20, 5.5, and 7 more
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: no
- Technical impact: total
Summary
In the Linux kernel, the following vulnerability has been resolved: pinctrl: devicetree: don't free uninitialized dev_name on error path dt_remember_or_free_map() duplicates dev_name for each map entry. If kstrdup_const() fails, dt_free_map() frees dev_name in all num_maps entries, including entries that have not been initialized. Some pinctrl drivers, including pinctrl-imx, allocate the map with kmalloc() and leave dev_name for the core to initialize. The untouched entries therefore contain uninitialized data which is passed to kfree_const(). Reproduced on qemu's mcimx6ul-evk (pinctrl-imx) with failslab injection while binding the pinctrl-consuming device, under KASAN: BUG: KASAN: double-free in dt_free_map+0x34/0xa4 Free of addr c425a900 by task init/1 kfree from dt_free_map+0x34/0xa4 dt_free_map from dt_remember_or_free_map+0x184/0x198 dt_remember_or_free_map from pinctrl_dt_to_map+0x33c/0x4c8 pinctrl_dt_to_map from create_pinctrl+0x9c/0x5c0 Initialize all dev_name fields to NULL before duplicating the device name, making the full-map cleanup safe after a partial failure.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: total
- Record last updated
Affected versions
- Linux Linux
From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in e3cfb22bad363bebcfd55d909e12d499cb8c5490; From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in 1586423da2739a80871ef6240016fcb9c7339bfb; From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in dec5f0a8080502908dec5e35597c7ae07d533a3b; From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in 929f6396baade89999ec8a1281232c101cbc727d; From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in 321fe3584a8298386938130d138191aa35040b75; From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in ad0ad3c228b6f76fde10f32047e0ec5fbc109dc8; From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in 9d00a5ac7cd3d32ae61140f4b8a62f136de84e7d; From be4c60b563edee3712d392aaeb0943a768df7023 · fixed in 015b5bcbcb622b32317642be91a7f79aa5413649; From 4.4.244 · fixed in 4.5; From 4.9.244 · fixed in 4.10; From 4.14.161 · fixed in 4.15; From 4.19.92 · fixed in 4.20; From 5.4.7 · fixed in 5.5
- Linux Linux
5.5
- KernelLinux
From 5.5.0 · fixed in 5.10.265; From 5.11.0 · fixed in 5.15.216; From 5.16.0 · fixed in 6.1.183; From 6.2.0 · fixed in 6.6.151; From 6.7.0 · fixed in 6.12.103; From 6.13.0 · fixed in 6.18.44; From 6.19.0 · fixed in 7.1.8
References 8
git.kernel.org
- stable/c/e3cfb22bad363bebcfd55d909e12d499cb8c5490
- stable/c/1586423da2739a80871ef6240016fcb9c7339bfb
- stable/c/dec5f0a8080502908dec5e35597c7ae07d533a3b
- stable/c/929f6396baade89999ec8a1281232c101cbc727d
- stable/c/321fe3584a8298386938130d138191aa35040b75
- stable/c/ad0ad3c228b6f76fde10f32047e0ec5fbc109dc8
- stable/c/9d00a5ac7cd3d32ae61140f4b8a62f136de84e7d
- stable/c/015b5bcbcb622b32317642be91a7f79aa5413649