bpf: Fix abuse of kprobe_write_ctx via freplace
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.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.18.33, 7.0.10
- CVEs
- CVE-2026-53095
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 19:56 UTC · Revision 1
Source evidence
bpf: Fix abuse of kprobe_write_ctx via freplace
core-osv · Original sourcePublished 24 Jun 2026, 16:30 UTC
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.
osv:CVE-2026-53095
Kernel
Fixed versions: 6.18.33, 7.0.10
Complete source record
{
"id": "b4fbdd939b4b3cd61df69f03620f52a5222e34b841da46c80f803bb3c79d58f7",
"url": "https://osv.dev/vulnerability/CVE-2026-53095",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "bpf: Fix abuse of kprobe_write_ctx via freplace",
"summary": "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.",
"evidence": "osv:CVE-2026-53095",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.18.33",
"evidence": "/affected/1/ranges"
},
{
"value": "7.0.10",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2026-53095",
"aliases": [
"CVE-2026-53095"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "7384893d970ea114952aef54ad7e3d7d2ca82d4f"
},
{
"fixed": "b312cf41b9e43f442613053f6cad39898e1baf96"
},
{
"fixed": "9836cadbd96c7e0dbb0018fa60e7872dd31ac4f8"
},
{
"fixed": "611fe4b79af72d00d80f2223354284447daafae9"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-53095.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.18.0"
},
{
"fixed": "6.18.33"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.19.0"
},
{
"fixed": "7.0.10"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-53095.json"
}
}
],
"modified": "2026-10-28T02:30:39.240513937Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/611fe4b79af72d00d80f2223354284447daafae9",
"https://git.kernel.org/stable/c/9836cadbd96c7e0dbb0018fa60e7872dd31ac4f8",
"https://git.kernel.org/stable/c/b312cf41b9e43f442613053f6cad39898e1baf96",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53095.json",
"https://nvd.nist.gov/vuln/detail/CVE-2026-53095",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53095.json"
}
},
"related_cves": [
{
"value": "CVE-2026-53095",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 506415,
"published_at": "2026-06-24T16:30:33.684+00:00"
}