Linux Kernel Chardev Error Handling Vulnerability in cdev_device_add()

Vulnerability

A vulnerability has been identified in the Linux kernel's character device handling, specifically within the cdev_device_add() function. This issue arises when the device_add() function encounters an error after a fault injection is applied. If the device's devt attribute is not set, the cdev_add() function is not called, leading to a situation where cdev_del() is unnecessary. The vulnerability causes a warning to be issued, indicating that a null kobject is being referenced, which can lead to improper error handling and potential resource management issues.

Impact

The vulnerability can cause a null pointer dereference, leading to a warning about an uninitialized kobject being released. This could disrupt normal operations and potentially be exploited to cause a denial of service.

Reproduction

The vulnerability can be reproduced by injecting faults into the device_add() function while registering a character device. This can be done by applying fault injection techniques that simulate errors during the device registration process. When the device_add() function fails and the dev->devt attribute is not set, the cdev_device_add() function does not properly handle the error, leading to the vulnerability.

Remediation

Users can upgrade to the latest stable version of the Linux kernel, where this vulnerability has been addressed. Instructions for downloading the latest kernel version can be found on the official Linux kernel website.

Added: Sep 15, 2025, 7:52 PM
Updated: Sep 15, 2025, 7:52 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
2.5
exploitability
4.3
remediation
7.7
relevance
0.5
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.