CVE-2026-93259: powerpc/irq: Fix missing r2 clobber in PCREL inline assembly
In the Linux kernel, the following vulnerability has been resolved:
powerpc/irq: Fix missing r2 clobber in PCREL inline assembly
In CONFIGPPCKERNELPCREL mode, r2 is no longer reserved for the TOC pointer and is available as a caller-saved register [0].
Both calldoirq() and calldosoftirq() use inline assembly to call functions with stack switching, but fail to list r2 in their clobber lists. This causes the compiler to assume r2 is preserved across these calls, leading to register corruption when the called functions (doirq and dosoftirq) clobber r2.
As a result of this kernel crash during interrupt handling is seen and the kernel fails to boot:
BUG: Unable to handle kernel data access on write at 0xc000000404697638 Faulting instruction address: 0xc0000000000181ec Oops: Kernel access of bad area, sig: 11 [#1] NIP [c0000000000181ec] doIRQ+0x6c/0xc0
With older GCC, the compiler would conservatively allocate callee-saved registers (like r31) for values spanning function calls, accidentally avoiding the bug:
<doIRQ>: 00 00 00 60 nop a6 02 08 7c mflr r0 f8 ff e1 fb std r31,-8(r1) f0 ff c1 fb std r30,-16(r1) 2d 03 10 06 pla r31,53297316
...
3d e8 ff 4b bl c0000000000165ac <doirq> 00 00 21 e8 ld r1,0(r1) 28 00 4d e9 ld r10,40(r13) 40 00 21 38 addi r1,r1,64 2a f9 aa 7f stdx r29,r10,r31
With newer GCC 14, the compiler uses r2 for such values, exposing the missing clobber specification:
<doIRQ>: 00 00 00 60 nop a6 02 08 7c mflr r0 f0 ff c1 fb std r30,-16(r1) f8 ff e1 fb std r31,-8(r1) 29 02 10 06 pla r2,36252592 # c0000000022aadc0 <irqregs>
...
85 dc ff 4b bl c000000000015ee0 <doirq> 00 00 21 e8 ld r1,0(r1) 28 00 2d e9 ld r9,40(r13) 30 00 21 38 addi r1,r1,48 2a 11 c9 7f stdx r30,r9,r2
Fix this by adding r2 to the clobber list for both calldoirq() and calldosoftirq() when CONFIGPPCKERNELPCREL is enabled.
[0]: https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg313226.html
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Add r2 to the clobber lists of both call_do_irq() and call_do_softirq() inline assembly when CONFIG_PPC_KERNEL_PCREL is enabled.
Event History
Frequently Asked Questions
Which deployments are affected?
The issue applies to Linux kernel builds for PowerPC that use CONFIG_PPC_KERNEL_PCREL. It concerns interrupt and softirq call paths that perform stack switching through inline assembly.
What is the expected operational impact?
Register corruption can occur when interrupt or softirq handlers clobber r2 while the compiler assumes it was preserved. Reported impact includes a kernel crash during interrupt handling and failure to boot.
How can I recognize this issue in a failing system?
A reported failure includes a kernel Oops stating "Unable to handle kernel data access on write" and identifies __do_IRQ in the faulting instruction path. The example also shows "Kernel access of bad area" with signal 11.
Why might the issue appear compiler-dependent?
Older GCC versions may conservatively keep values that span calls in callee-saved registers such as r31, which can accidentally avoid the corruption. This behavior does not correct the missing r2 clobber declaration.