CVE-2026-53095 bpf: Fix abuse of kprobe_write_ctx via freplace

Medium 5.5 Published Updated

Attackers can abuse BPF freplace programs to modify kernel registers, potentially leading to privilege escalation or arbitrary code execution.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2026-53095?

CVE-2026-53095 is a medium-severity vulnerability in Linux kernel, published on 24 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix abuse of kprobe_write_ctx via freplace

uprobe programs are allowed to modify struct pt_regs.

Since the actual program type of uprobe is KPROBE, it can be abused to modify struct pt_regs via kprobe+freplace when the kprobe attaches to kernel functions.

For example,

SEC("?kprobe") int kprobe(struct pt_regs *regs) { return 0; }

SEC("?freplace") int freplace_kprobe(struct pt_regs *regs) { regs->di = 0; return 0; }

freplace_kprobe prog will attach to kprobe prog. kprobe prog will attach to a kernel function.

Without this patch, when the kernel function runs, its first arg will always be set as 0 via the freplace_kprobe prog.

To fix the abuse of kprobe_write_ctx=true via kprobe+freplace, disallow attaching freplace programs on kprobe programs with different kprobe_write_ctx values.

Which versions are affected by CVE-2026-53095?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2026-53095?

Apply the vendor's patch.

Is CVE-2026-53095 being exploited?

There is no known exploitation of CVE-2026-53095 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2026-53095, DEBIAN-CVE-2026-53095, GHSA-8mpp-jf4m-xx27, UBUNTU-CVE-2026-53095.

Is CVE-2026-53095 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free