CVE-2022-50282

chardev: fix error handling in cdev_device_add()

MEDIUM
5.5
CVSS Score
Published: September 15, 2025 at 02:21 PM UTC
Updated: June 17, 2026 at 05:23 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%

Description

In the Linux kernel, the following vulnerability has been resolved: chardev: fix error handling in cdev_device_add() While doing fault injection test, I got the following report: ------------[ cut here ]------------ kobject: '(null)' (0000000039956980): is not initialized, yet kobject_put() is being called. WARNING: CPU: 3 PID: 6306 at kobject_put+0x23d/0x4e0 CPU: 3 PID: 6306 Comm: 283 Tainted: G W 6.1.0-rc2-00005-g307c1086d7c9 #1253 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:kobject_put+0x23d/0x4e0 Call Trace: <TASK> cdev_device_add+0x15e/0x1b0 __iio_device_register+0x13b4/0x1af0 [industrialio] __devm_iio_device_register+0x22/0x90 [industrialio] max517_probe+0x3d8/0x6b4 [max517] i2c_device_probe+0xa81/0xc00 When device_add() is injected fault and returns error, if dev->devt is not set, cdev_add() is not called, cdev_del() is not needed. Fix this by checking dev->devt in error path.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 3.16.83v ≥ 4.4.2243.16.83 ≤ v < 3.174.12 ≤ v < 4.14.3034.12 ≤ v < 4.19.2704.12 ≤ v < 5.10.1634.12 ≤ v < 5.15.864.12 ≤ v < 5.4.2294.12 ≤ v < 6.0.164.12 ≤ v < 6.1.24.12 ≤ v < 6.24.15 ≤ v < 4.19.2704.20 ≤ v < 5.4.2294.4.224 ≤ v < 4.54.9.224 ≤ v < 4.9.3375.11 ≤ v < 5.15.865.16 ≤ v < 6.0.165.5 ≤ v < 5.10.1636.1 ≤ v < 6.1.2233ed09d7fdacf592ee91e6c97ce5f4364fbe7c03.16.834.124.4.2244.9.224d79d7d5c878809964da537336dad5ff55fa1605eda97a80a657d1b1b50ef633e8ff5dbf0d417fc8df78b54e7d83c7879f9a6e49e6724019ca34177cc
Vendor states this is fixed in 11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797 (fixed)
Vendor states this is fixed in 28dc61cc49c6e995121c6d86bef4b73df78dda80 (fixed)
Vendor states this is fixed in 34d17b39bceef25e4cf9805cd59250ae05d0a139 (fixed)
Vendor states this is fixed in 5d2146889fad4cb9e6c13e790d4cfd871486eca8 (fixed)
Vendor states this is fixed in 6acf8597c5b04f455ee0649e11e5f3bcd28f381e (fixed)
Vendor states this is fixed in 85a5660491b507d33662b8e81c142e6041e642eb (fixed)
Vendor states this is fixed in b5de1eac71fec1af7723f1083d23a24789fd795c (fixed)
Vendor states this is fixed in c46db6088bccff5115674d583fef46ede80077a2 (fixed)
Vendor states this is fixed in d85b5247a79355b8432bfd9ac871f96117f750d4 (fixed)
Affected range stops below 3.17, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 4.12 (unaffected)
Vendor states this is fixed in 4.14.303 (unaffected)
Vendor states this is fixed in 4.19.270 (unaffected)
Affected range stops below 4.5, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 4.9.337 (unaffected)
Vendor states this is fixed in 5.10.163 (unaffected)
Vendor states this is fixed in 5.15.86 (unaffected)
Vendor states this is fixed in 5.4.229 (unaffected)
Vendor states this is fixed in 6.0.16 (unaffected)
Vendor states this is fixed in 6.1.2 (unaffected)
Vendor states this is fixed in 6.2 (unaffected)

References (9)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/28dc61cc49c6e995121c6d86bef4b73df78dda80
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/34d17b39bceef25e4cf9805cd59250ae05d0a139
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/5d2146889fad4cb9e6c13e790d4cfd871486eca8
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/6acf8597c5b04f455ee0649e11e5f3bcd28f381e
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/85a5660491b507d33662b8e81c142e6041e642eb
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b5de1eac71fec1af7723f1083d23a24789fd795c
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c46db6088bccff5115674d583fef46ede80077a2

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-908

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card