CVE-2026-92519: riscv, bpf: Fix memory leak in bpf_jit_free
In the Linux kernel, the following vulnerability has been resolved:
riscv, bpf: Fix memory leak in bpfjitfree
When bpfintjitcompile() is called for subprograms, it returns early during the first pass (!prog->isfunc || extrapass 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 bpfjitfree() to clean up the first subprogram. However, bpfjitfree() fails to free jitdata->ctx.offset, which causes a memory leak of the JIT context offsets array.
Fix this by adding the missing kfree(jitdata->ctx.offset) in bpfjitfree().
Affected Software
Event History
Frequently Asked Questions
Under what circumstances does the memory leak occur?
The leak occurs when BPF JIT compilation is performed for subprograms and compilation later fails after an earlier subprogram retained its JIT context offsets array for an extra pass. The cleanup path then calls bpf_jit_free(), which did not free jit_data->ctx.offset.
What is the impact if the affected failure path is triggered?
The JIT context offsets array allocated for the earlier subprogram is not released, causing a kernel memory leak. The provided information does not describe any impact beyond the leaked memory.
What code change resolves the issue?
The fix adds kfree(jit_data->ctx.offset) to bpf_jit_free() so the retained JIT context offsets array is released during cleanup.