dm-stats: fix a crash if allocation of per-cpu data fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fd2ed4d252701d3bbed4cd3e3d267ad469bb832a · < 74210fa072960a18bb0eead487585452af722e4f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
dm-stats: fix a crash if allocation of per-cpu data fails
If "dm_kvzalloc(percpu_alloc_size, cpu_to_node(cpu))" fails, the code jumps to the "out" label and calls dm_stat_free. dm_stat_free does "for_each_possible_cpu(cpu) { dm_kvfree(s->stat_percpu[cpu][0].histogram, s->histogram_alloc_size);", which crashes with NULL pointer dereference if s->stat_percpu[cpu] is NULL.
This commit fixes the bug by testing s->stat_percpu[cpu] for NULL before using it.
From the CVE record · Linux
The Linux kernel's dm-stats code can dereference a NULL pointer if allocation of per-CPU data fails, causing a crash. The input does not specify an attack path, authentication requirements, or user interaction.
Engineers running the Linux kernel should check whether their builds include the dm-stats fix; affected versions are not specified.