CVE-2024-42126: powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.
In the Linux kernel, the following vulnerability has been resolved:
powerpc: Avoid nmienter/nmiexit in real mode interrupt.
nmienter()/nmiexit() touches per cpu variables which can lead to kernel crash when invoked during real mode interrupt handling (e.g. early HMI/MCE interrupt handler) if percpu allocation comes from vmalloc area.
Early HMI/MCE handlers are called through DEFINEINTERRUPTHANDLERNMI() wrapper which invokes nmienter/nmiexit calls. We don't see any issue when percpu allocation is from the embedded first chunk. However with CONFIGNEEDPERCPUPAGEFIRSTCHUNK enabled there are chances where percpu allocation can come from the vmalloc area.
With kernel command line "percpualloc=page" we can force percpu allocation to come from vmalloc area and can see kernel crash in machinecheckearly:
[ 1.215714] NIP [c000000000e49eb4] rcunmienter+0x24/0x110 [ 1.215717] LR [c0000000000461a0] machinecheckearly+0xf0/0x2c0 [ 1.215719] --- interrupt: 200 [ 1.215720] [c000000fffd73180] [0000000000000000] 0x0 (unreliable) [ 1.215722] [c000000fffd731b0] [0000000000000000] 0x0 [ 1.215724] [c000000fffd73210] [c000000000008364] machinecheckearlycommon+0x134/0x1f8
Fix this by avoiding use of nmienter()/nmiexit() in real mode if percpu first chunk is not embedded.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-42126?
CVE-2024-42126 has a high severity rating due to its potential to cause kernel crashes.
How do I fix CVE-2024-42126?
To fix CVE-2024-42126, update to the latest patched versions of the Linux kernel, specifically versions 6.1.123-1, 6.1.128-1, or 6.12.12-1.
What versions of Linux are affected by CVE-2024-42126?
CVE-2024-42126 affects Linux kernel versions up to and including 5.10.226-1 and certain 6.1 versions.
Can CVE-2024-42126 lead to data loss?
Yes, CVE-2024-42126 can lead to data loss due to kernel crashes during real mode interrupt handling.
Is there a workaround for CVE-2024-42126?
There is no known workaround for CVE-2024-42126; the only mitigation is to apply the available updates.