ftrace: Also allocate and copy hash for reading of filter files
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c20489dad156dd9919ebd854bbace46dbd2576a3 · < c591ba1acd081d4980713e47869dd1cc3d963d19| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ftrace: Also allocate and copy hash for reading of filter files
Currently the reader of set_ftrace_filter and set_ftrace_notrace just adds the pointer to the global tracer hash to its iterator. Unlike the writer that allocates a copy of the hash, the reader keeps the pointer to the filter hashes. This is problematic because this pointer is static across function calls that release the locks that can update the global tracer hashes. This can cause UAF and similar bugs.
Allocate and copy the hash for reading the filter files like it is done for the writers. This not only fixes UAF bugs, but also makes the code a bit simpler as it doesn't have to differentiate when to free the iterator's hash between writers and readers.
From the CVE record · Linux
The Linux kernel’s ftrace filter-file readers retain a pointer to a global tracer hash instead of copying it. Reading set_ftrace_filter or set_ftrace_notrace while that hash is updated can cause a use-after-free or similar bug. The input does not establish an attacker access level or authentication requirement.
Engineers running the Linux kernel should check their deployments; affected versions were not provided.