CVE-2026-53095

bpf: Fix abuse of kprobe_write_ctx via freplace

Published Jun 24, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability resides in the Linux kernel, where uprobe programs that are allowed to write to the BPF program context (kprobe_write_ctx) can be abused through a freplace BPF program. A freplace program can alter values in the kernel register structure (struct pt_regs). When a kernel function is invoked via a kprobe, the modified registers are used, allowing an attacker to force the first argument of any kernel function to a value of their choosing, including zero. This manipulation can lead to arbitrary kernel‑mode escalation. The weakness is identified as CWE‑94.

Affected Systems

The affected product is the Linux kernel across all vendors that ship Linux. No specific kernel version range is listed, indicating the issue exists wherever this combination of kprobe and freplace BPF functionality is present.

Risk and Exploitability

Based on the EPSS score of < 1%, a very low probability of exploitation is inferred; the vulnerability is not listed in the CISA KEV catalog, and its CVSS of 5.5 indicates moderate impact. Based on the description, an attacker would require local access with the ability to load BPF programs, typically requiring root or CAP_SYS_ADMIN privileges. Based on the description, the likely attack vector is local; an attacker can attach a freplace BPF program to a kprobe and manipulate kernel registers so that the first argument of any kernel function is forced to an attacker‑chosen value, potentially leading to arbitrary kernel‑mode escalation. The patch eliminates this attack path by disallowing freplace programs on kprobe programs with mismatched kprobe_write_ctx values.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a kernel release that includes the patch from commit 611fe4b7... and the associated fixes
  • If an immediate kernel upgrade is not feasible, ensure that only privileged users can load BPF programs and enforce that kprobe_write_ctx is disabled for BPF programs that are not required
  • Audit and programs for unnecessary use of kprobe or freplace and remove or replace those that modify pt_regs

Generated by OpenCVE AI on August 12, 2026 at 07:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8566-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8568-1 Linux kernel (OEM) vulnerabilities
Ubuntu USN Ubuntu USN USN-8569-1 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-8593-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8603-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-8618-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8663-1 Linux kernel (NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-8664-1 Linux kernel (NVIDIA BaseOS) vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-1 Linux kernel (GCP) vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-2 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-3 Linux kernel (Oracle) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-285
Type Values Removed Values Added
Weaknesses CWE-94
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

threat_severity

Important

Type Values Removed Values Added
Weaknesses CWE-285
Type Values Removed Values Added
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.
Title bpf: Fix abuse of kprobe_write_ctx via freplace
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Jun 24, 2026, 4:30 PM
Reserved
Jun 9, 2026, 7:44 AM
Status
Analyzed
Published
Jun 24, 2026, 5:17 PM
Modified
Jul 21, 2026, 6:21 PM
Severity
Important
Public date
Jun 24, 2026, 12:00 AM