LoongArch: BPF: Refactor jump offset calculation in tail call
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
1a782fa32e644aa9fbae6c8488f3e61221ac96e1| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
LoongArch: BPF: Refactor jump offset calculation in tail call
The old macro-based jmp_offset calculation derives the jump distance from a stale prior-pass code stride, which can lead to wrong branch offsets and soft lockups under extra JIT passes.
Fix this by calculating the offset directly on the absolute target: "ctx->offset[insn + 1] - ctx->idx".
To avoid a false 16-bit range check abort during size estimation, add a "ctx->image == NULL" guard to inject a safe dummy offset.
From the CVE record · Linux
The Linux kernel’s LoongArch BPF tail-call JIT can calculate jump offsets using a stale code stride. Under extra JIT passes, this can produce incorrect branches and soft lockups. The input does not specify how an attacker could trigger this or whether authentication or user interaction is required.
Engineers running the Linux kernel on LoongArch should check their affected versions; no version range is provided.