CVE-2022-50282

Source
https://cve.org/CVERecord?id=CVE-2022-50282
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50282.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50282
Downstream
Related
Published
2025-09-15T14:21:18.658Z
Modified
2026-04-02T08:28:23.343694Z
Summary
chardev: fix error handling in cdev_device_add()
Details

In the Linux kernel, the following vulnerability has been resolved:

chardev: fix error handling in cdevdeviceadd()

While doing fault injection test, I got the following report:

------------[ cut here ]------------ kobject: '(null)' (0000000039956980): is not initialized, yet kobjectput() is being called. WARNING: CPU: 3 PID: 6306 at kobjectput+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:kobjectput+0x23d/0x4e0 Call Trace: <TASK> cdevdevice_add+0x15e/0x1b0 __iiodeviceregister+0x13b4/0x1af0 [industrialio] __devmiiodeviceregister+0x22/0x90 [industrialio] max517probe+0x3d8/0x6b4 [max517] i2cdeviceprobe+0xa81/0xc00

When deviceadd() is injected fault and returns error, if dev->devt is not set, cdevadd() is not called, cdev_del() is not needed. Fix this by checking dev->devt in error path.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50282.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
da97a80a657d1b1b50ef633e8ff5dbf0d417fc8d
Fixed
5d2146889fad4cb9e6c13e790d4cfd871486eca8
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
233ed09d7fdacf592ee91e6c97ce5f4364fbe7c0
Fixed
6acf8597c5b04f455ee0649e11e5f3bcd28f381e
Fixed
34d17b39bceef25e4cf9805cd59250ae05d0a139
Fixed
d85b5247a79355b8432bfd9ac871f96117f750d4
Fixed
c46db6088bccff5115674d583fef46ede80077a2
Fixed
28dc61cc49c6e995121c6d86bef4b73df78dda80
Fixed
b5de1eac71fec1af7723f1083d23a24789fd795c
Fixed
85a5660491b507d33662b8e81c142e6041e642eb
Fixed
11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
f78b54e7d83c7879f9a6e49e6724019ca34177cc
Last affected
d79d7d5c878809964da537336dad5ff55fa1605e

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50282.json"