CVE-2022-49875 bpftool: Fix NULL pointer dereference when pin {PROG, MAP, LINK} without FILE
A local attacker can cause a segmentation fault and denial of service in the Linux kernel by using bpftool to pin objects without specifying a file.
- 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-2022-49875?
CVE-2022-49875 is a medium-severity vulnerability in Linux kernel, published on 1 May 2025. 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:
bpftool: Fix NULL pointer dereference when pin {PROG, MAP, LINK} without FILE
When using bpftool to pin {PROG, MAP, LINK} without FILE, segmentation fault will occur. The reson is that the lack of FILE will cause strlen to trigger NULL pointer dereference. The corresponding stacktrace is shown below:
do_pin do_pin_any do_pin_fd mount_bpffs_for_pin strlen(name) <- NULL pointer dereference
Fix it by adding validation to the common process.
Weakness: CWE-476
Which versions are affected by CVE-2022-49875?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-49875?
Apply the vendor's patch.
Is CVE-2022-49875 being exploited?
There is no known exploitation of CVE-2022-49875 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-49875, GHSA-c8r4-j2q4-mjgj, UBUNTU-CVE-2022-49875.