powerpc/perf: fix preempt count underflow in fsl_emb_pmu_del
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a11106544f33c104706ae42d27219a409b67478e · < 73711688479df333acc134e3730fff1acba1843e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
powerpc/perf: fix preempt count underflow in fsl_emb_pmu_del
fsl_emb_pmu_del() unconditionally calls put_cpu_var(cpu_hw_events) at the 'out:' label, but only calls the matching get_cpu_var() after the 'i < 0' early-return check. When event->hw.idx is negative the function jumps to 'out:' without having taken get_cpu_var(), and the trailing put_cpu_var() then issues an unmatched preempt_enable(), underflowing preempt_count.
On a CONFIG_PREEMPT=y kernel preempt_count would underflow and eventually present as a 'scheduling while atomic' BUG.
Move put_cpu_var() to pair with get_cpu_var() so the percpu access is correctly bracketed and the 'out:' label only handles perf_pmu_enable.
From the CVE record · Linux
The Linux kernel’s powerpc/perf code can underflow the preemption count when a perf event has a negative hardware index. On a kernel built with CONFIG_PREEMPT=y, this can eventually cause a “scheduling while atomic” BUG. The input does not specify an attack path, authentication requirements, or user interaction.
Engineers running Linux kernels with the affected powerpc/perf code should check their vendor’s advisory; affected versions are not specified.