tracing: Take the reference before publishing the named histogram trigger
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
740dab2338f70d93aa8235db5a9541d846d7b21c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tracing: Take the reference before publishing the named histogram trigger
event_hist_trigger_named_init() puts the trigger on the global named_triggers list and only then takes the reference on the trigger it shares its histogram with:
data->ref++;
save_named_trigger(data->named_data->name, data);
ret = event_hist_trigger_init(data->named_data); if (ret < 0) { kfree(data->cmd_ops); data->cmd_ops = &trigger_hist_cmd; }
return ret;
event_hist_trigger_init() fails when alloc_hist_pad() cannot allocate, and nothing takes the trigger back off the list on the way out. event_hist_trigger_parse() frees it, and the next lookup by name reads the freed object:
From the CVE record · Linux
The Linux kernel can leave a freed named histogram trigger on a global list if allocation fails during trigger initialization. A subsequent lookup by name reads the freed object. This requires the ability to configure event histogram triggers; the input does not specify whether authentication or other user interaction is needed.
Engineers running Linux kernels with tracing histogram triggers should check their kernel versions against the vendor advisory; affected versions were not provided.