of: unittest: fix use-after-free in of_unittest_changeset()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
of: unittest: fix use-after-free in of_unittest_changeset()
The variable 'parent' is assigned the value of 'nchangeset' earlier in the function, meaning both point to the same struct device_node. The call to of_node_put(nchangeset) can decrement the reference count to zero and free the node if there are no other holders. After that, the code still uses 'parent' to check for the presence of a property and to read a string property, leading to a use-after-free.
Fix this by moving the of_node_put() call after the last access to 'parent', avoiding the UAF.
From the CVE record · Linux
In the Linux kernel, of_unittest_changeset() can access a device node after its reference count reaches zero and it is freed. The input does not describe an attacker path or impact beyond the use-after-free, or specify whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel should check their versions; affected versions are not specified in the input.