net: mctp i3c: clean up notifier and buses if driver register fails
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:
net: mctp i3c: clean up notifier and buses if driver register fails
mctp_i3c_mod_init() registers the I3C bus notifier and then walks the existing buses with i3c_for_each_bus_locked(mctp_i3c_bus_add_new, NULL) before registering the I3C device driver. If i3c_driver_register() fails, the function returns the error directly, leaving the notifier registered and every mctp_i3c_bus object created for the existing buses allocated. The notifier is left pointing into the module that failed to load and the bus list is leaked.
Mirror the module exit path on this failure: unregister the notifier and tear down the buses that were added before returning the error.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
From the CVE record · Linux
If I3C driver registration fails during MCTP I3C module initialization, the kernel leaves a bus notifier registered and leaks bus objects. The notifier then points into a module that failed to load; the input does not describe an attack path or authentication or user-interaction requirements.
Engineers running Linux kernels with the MCTP I3C module should check their kernel against the vendor advisory; affected versions were not provided.