{"id":"CVE-2026-53095","summary":"bpf: Fix abuse of kprobe_write_ctx via freplace","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix abuse of kprobe_write_ctx via freplace\n\nuprobe programs are allowed to modify struct pt_regs.\n\nSince the actual program type of uprobe is KPROBE, it can be abused to\nmodify struct pt_regs via kprobe+freplace when the kprobe attaches to\nkernel functions.\n\nFor example,\n\nSEC(\"?kprobe\")\nint kprobe(struct pt_regs *regs)\n{\n\treturn 0;\n}\n\nSEC(\"?freplace\")\nint freplace_kprobe(struct pt_regs *regs)\n{\n\tregs-\u003edi = 0;\n\treturn 0;\n}\n\nfreplace_kprobe prog will attach to kprobe prog.\nkprobe prog will attach to a kernel function.\n\nWithout this patch, when the kernel function runs, its first arg will\nalways be set as 0 via the freplace_kprobe prog.\n\nTo fix the abuse of kprobe_write_ctx=true via kprobe+freplace, disallow\nattaching freplace programs on kprobe programs with different\nkprobe_write_ctx values.","modified":"2026-07-08T08:07:23.711854505Z","published":"2026-06-24T16:30:33.684Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53095.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/611fe4b79af72d00d80f2223354284447daafae9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9836cadbd96c7e0dbb0018fa60e7872dd31ac4f8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b312cf41b9e43f442613053f6cad39898e1baf96"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53095.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53095"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.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"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.18.0"},{"fixed":"6.18.33"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.0.10"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-53095.json"}}],"schema_version":"1.7.5"}