USB: dwc3: fix memory leak with using debugfs_lookup()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
USB: dwc3: fix memory leak with using debugfs_lookup()
When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once.
Note, the root dentry for the debugfs directory for the device needs to be saved so we don't have to keep looking it up, which required a bit more refactoring to properly create and remove it when needed.
From the CVE record · Linux
The Linux kernel’s USB dwc3 component leaks memory over time when a debugfs_lookup() result is not released. The input does not specify how an attacker could trigger the leak or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the USB dwc3 component should check their versions; affected versions are not specified.