CVE-2026-89905: LoongArch: BPF: Move arena register slot below TCC context
In the Linux kernel, the following vulnerability has been resolved:
LoongArch: BPF: Move arena register slot below TCC context
Currently, the stack layout places the optional arena register slot above the tail call counter context. When arenavmstart is dynamically enabled, it shifts the relative offset of the tccptr slot within the stack frame, causing hardcoded tracking macros to mismatch and leading to memory misalignment or corruption potentially.
To fix this, move the arena register save and restore sequences below the tail call counter context slots in both buildprologue() and the epilogue.
Update buildepilogue() to insert a proper offset decrement to safely skip the unneeded tccptr reading block while accurately aligning with the relocated arena slot at the very bottom.
With this patch, the tccptr slot is always positioned at a fixed distance directly underneath the base callee-saved registers that is independent of whether the arena features are on.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
The issue affects the Linux kernel on LoongArch systems using BPF when the optional arena feature is dynamically enabled through arena_vm_start. The problematic layout depends on the arena register slot being present.
What changes with the fix?
The fix relocates the arena register save and restore slot below the tail call counter context and adjusts epilogue offset handling. This keeps the tcc_ptr slot at a fixed position regardless of whether arena support is enabled, preventing offset mismatches and potential memory misalignment or corruption.