fs: sysfs: Fix reference leak in sysfs_break_active_protection()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2afc9166f79b8f6da5f347f48515215ceee4ae37 · < ac107356aabc362aaeb77463e814fc067a5d3957| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fs: sysfs: Fix reference leak in sysfs_break_active_protection()
The sysfs_break_active_protection() routine has an obvious reference leak in its error path. If the call to kernfs_find_and_get() fails then kn will be NULL, so the companion sysfs_unbreak_active_protection() routine won't get called (and would only cause an access violation by trying to dereference kn->parent if it was called). As a result, the reference to kobj acquired at the start of the function will never be released.
Fix the leak by adding an explicit kobject_put() call when kn is NULL.
From the CVE record · Linux
The Linux kernel’s sysfs_break_active_protection() routine leaks a kobject reference if kernfs_find_and_get() fails. The input does not specify how an attacker could trigger this failure or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their versions; affected versions are not specified in the input.