CVE-2022-50453 gpiolib: cdev: fix NULL-pointer dereferences
A local attacker can crash the Linux kernel by triggering a NULL pointer dereference in the GPIO character device driver during device unbinding.
- 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-50453?
CVE-2022-50453 is a medium-severity vulnerability in Linux kernel, published on 1 Oct 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:
gpiolib: cdev: fix NULL-pointer dereferences
There are several places where we can crash the kernel by requesting lines, unbinding the GPIO device, then calling any of the system calls relevant to the GPIO character device's annonymous file descriptors: ioctl(), read(), poll().
While I observed it with the GPIO simulator, it will also happen for any of the GPIO devices that can be hot-unplugged - for instance any HID GPIO expander (e.g. CP2112).
This affects both v1 and v2 uAPI.
This fixes it partially by checking if gdev->chip is not NULL but it doesn't entirely remedy the situation as we still have a race condition in which another thread can remove the device after the check.
Weakness: CWE-476
Which versions are affected by CVE-2022-50453?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-50453?
Apply the vendor's patch.
Is CVE-2022-50453 being exploited?
There is no known exploitation of CVE-2022-50453 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-50453, GHSA-c44q-mxrg-grc2, UBUNTU-CVE-2022-50453.