Linux kernel histogram corruption in tracing field variables
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 02205a6752f223779a1b0e9e8ffacbea6e717851 · < 3609ada3c12cecfb0ae5ee82ef4f86c5f18a2dea| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tracing: Save the event file instead of the compatible histogram
create_field_var_hist() creates a histogram on the matched event to supply a field variable, and records it on the target so it can be torn down later:
hist_data = find_compatible_hist(target_hist_data, file); ... /* Save the compatible histogram information */ var_hist->hist_data = hist_data;
hist_data is not the histogram it creates. It is one that was already there, whose keys the new one copies. The saved pointer has a single user, unregister_field_var_hists(), which runs when the target is removed:
file = hist_data->field_var_hists[i]->hist_data->event_file;
find_compatible_hist() matches on keys alone, so it can pick one with no variables of its own. check_var_refs() then returns false and the user can remove it while the target still points at it:
BUG: KASAN: slab-use-after-free in event_hist_trigger_free+0x2b2/0x320 Read of size 8 at addr ffff8880093b90e0 by task init/1
From the CVE record · Linux
The Linux kernel's tracing code can retain a pointer to a compatible histogram that a user can remove while a target still references it. Removing the target afterward can cause a use-after-free. The input does not specify whether exploitation requires local access, authentication, or other user interaction.
Engineers running Linux kernels with tracing histogram triggers should check their vendor's advisory; affected versions are not specified.