wg.copyfail.patch
wg.copyfail.patch copied to clipboard
CVE-2026-31431 eBPF fix
CVE-2026-31431 aka Copy.Fail eBPF workaround
Why it matters
This CVE allows authorized user change cache copy of any readable file, which leads to Local Privilege Escalation (aka local root exploit), sandbox/container escape and other issues. It works by creating AF_ALG socket that is provided by algif* kernel modules.
Current well-known workaround recommends disabling algif_aead module, that is not possible if the module is built-in, like in Fedora Linux, Oracle Linux and others RHEL-based. Also, some upstreams are still missing the patch. It means your systems will be vulnerable until you patch your kernel.
Solution
This package provides you two eBPF programs:
- ebpf-alg-socket-filter, which filters AF_ALG socket creation by eBPF/LSM kernel mechanism
- ebpf-alg-socket-killer, which kills any program that creates AF_ALG socket
I recommend use first one IF you have eBPF LSM module enabled in your kernel. You can check it by calling
cat /sys/kernel/security/lsm
and checking if bpf is there.
If you don't have eBPF LSM module, use second program, it's more rude but protects as well.
Building
- Install clang, kernel-heders, libbpf-devel and bpftool
- Copy vmlinux.h from your kernel headers
- run
build.sh build
Running
- Run
apply.sh loadto load - Run
apply.sh unloadto unload - Run
apply.sh statusto check status