CVE-2026-68285

LoongArch: BPF: Fix memory leak in bpf_jit_free()

Published Aug 10, 2026 CVSS n/a EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

LoongArch: BPF: Fix memory leak in bpf_jit_free()

When bpf_int_jit_compile() is called for subprograms, it returns early
during the first pass (!prog->is_func || extra_pass is false), keeping
ctx->offset alive for the subsequent extra pass.

If JIT compilation fails for a later subprogram, the BPF core aborts and
calls bpf_jit_free() to clean up the first subprogram. However,
bpf_jit_free() fails to free jit_data->ctx.offset, which causes a memory
leak of the JIT context offsets array.

So fix this by adding the missing kvfree(jit_data->ctx.offset) in
bpf_jit_free().

Analysis

AI-generated

Technical impact

The vulnerability occurs in the LoongArch port of the Linux kernel where the BPF Just‑In‑Time (JIT) compiler does not release the offset array associated with a compiled subprogram when the compilation of a subsequent subprogram fails. This missing cleanup results in a memory leak – a type of resource exhaustion weakness (CWE‑772). Over time repeated JIT compilation attempts that encounter errors will exhaust kernel memory, potentially destabilizing or crashing the system.

Affected Systems

Linux kernel running on LoongArch CPUs. The vulnerability is present in any kernel version that implements the bpf_jit_free function without the recent patch. The affected source is the LoongArch BPF JIT code; no specific version numbers are listed in the advisories.

Risk and Exploitability

The EPSS score is less than 1 % and the issue is not listed in the CISA KEV catalog, indicating a low probability of exploitation in the wild. The likely vector involves the execution of BPF programs that trigger JIT compilation; an attacker or privileged process that can load BPF filters can provoke the failed compilation scenario. Although the flaw does not enable arbitrary code execution or privilege escalation, it can lead to gradual kernel memory depletion, slowing or crashing services if left unmitigated.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the patch for bpf_jit_free.
  • Disable BPF JIT compilation by setting the sysctl net.core.bpf_jit_enabled to 0 (or the equivalent setting for LoongArch).
  • Restrict loading of BPF programs to trusted users and enforce limits on the number or size of BPF programs a user can load.
  • Monitor kernel memory usage for signs of sustained increase following BPF compilation events.

Generated by OpenCVE AI on August 13, 2026 at 06:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-401
Type Values Removed Values Added
Weaknesses CWE-401
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: LoongArch: BPF: Fix memory leak in bpf_jit_free() When bpf_int_jit_compile() is called for subprograms, it returns early during the first pass (!prog->is_func || extra_pass is false), keeping ctx->offset alive for the subsequent extra pass. If JIT compilation fails for a later subprogram, the BPF core aborts and calls bpf_jit_free() to clean up the first subprogram. However, bpf_jit_free() fails to free jit_data->ctx.offset, which causes a memory leak of the JIT context offsets array. So fix this by adding the missing kvfree(jit_data->ctx.offset) in bpf_jit_free().
Title LoongArch: BPF: Fix memory leak in bpf_jit_free()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-772

    Missing Release of Resource after Effective Lifetime

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Aug 17, 2026, 5:02 AM
Reserved
Jul 30, 2026, 9:28 AM
Status
Received
Published
Aug 10, 2026, 1:20 PM
Modified
Aug 17, 2026, 5:18 AM
Severity
Public date
Aug 10, 2026, 12:00 AM