CVE-2022-50148 kernfs: fix potential NULL dereference in __kernfs_remove
A NULL pointer dereference in the Linux kernel's kernfs subsystem can cause a system crash when lockdep is enabled.
- 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-50148?
CVE-2022-50148 is a medium-severity vulnerability in Linux kernel, published on 18 Jun 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:
kernfs: fix potential NULL dereference in __kernfs_remove
When lockdep is enabled, lockdep_assert_held_write would cause potential NULL pointer dereference.
Fix the following smatch warnings:
fs/kernfs/dir.c:1353 __kernfs_remove() warn: variable dereferenced before check 'kn' (see line 1346)
Weakness: CWE-476
Which versions are affected by CVE-2022-50148?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-50148?
Apply the vendor's patch.
Is CVE-2022-50148 being exploited?
There is no known exploitation of CVE-2022-50148 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-50148, GHSA-r3cx-wcp6-7g33, UBUNTU-CVE-2022-50148.