tracing: fprobe events: Fix possible UAF on modules
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:
tracing: fprobe events: Fix possible UAF on modules
Commit ac91052f0ae5 ("tracing: tprobe-events: Fix leakage of module refcount") moved try_module_get() from __find_tracepoint_module_cb() to find_tracepoint() caller, but that introduced a possible UAF because the module can be unloaded before try_module_get(). In this case, the module object should be freed too. Thus, try_module_get() does not only fail but may access to the freed object.
To avoid that, try_module_get() in __find_tracepoint_module_cb() again.
From the CVE record · Linux
A module reference-counting change in Linux kernel tracing can cause a use-after-free if a module is unloaded before its reference is acquired. The description does not establish how an attacker could trigger this condition or whether access or user interaction is required.
Engineers running Linux kernels with tracing fprobe events should check their kernel version; affected versions are not specified.