Skip to content
Heist/ feed
Back to feed
UnratedFix available

chardev: fix error handling in cdev_device_add()

Type: advisorySources: OSV

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: 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.

Products
Kernel
Affected versions
Not specified
Fixed versions
4.14.303, 4.19.270, 4.9.337, 5.10.163, 5.15.86, 5.4.229, 6.0.16, 6.1.2
CVEs
CVE-2022-50282
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 02:56 UTC · Revision 1

Source evidence

chardev: fix error handling in cdev_device_add()

core-osv · Original source

Published 15 Sept 2025, 14:21 UTC

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: 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.

osv:CVE-2022-50282

Kernel

Fixed versions: 4.9.337, 4.14.303, 4.19.270, 5.4.229, 5.10.163, 5.15.86, 6.0.16, 6.1.2

Complete source record
{
  "id": "199d5d063d347e8867c82c8ab140a5569ce4cc81643ab7cac85996c879c41e4c",
  "url": "https://osv.dev/vulnerability/CVE-2022-50282",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "chardev: fix error handling in cdev_device_add()",
    "summary": "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: 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.",
    "evidence": "osv:CVE-2022-50282",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.9.337",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.14.303",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.19.270",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.4.229",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.163",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.86",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.0.16",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.2",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2022-50282",
      "aliases": [
        "CVE-2022-50282"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "da97a80a657d1b1b50ef633e8ff5dbf0d417fc8d"
                },
                {
                  "fixed": "5d2146889fad4cb9e6c13e790d4cfd871486eca8"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "233ed09d7fdacf592ee91e6c97ce5f4364fbe7c0"
                },
                {
                  "fixed": "6acf8597c5b04f455ee0649e11e5f3bcd28f381e"
                },
                {
                  "fixed": "34d17b39bceef25e4cf9805cd59250ae05d0a139"
                },
                {
                  "fixed": "d85b5247a79355b8432bfd9ac871f96117f750d4"
                },
                {
                  "fixed": "c46db6088bccff5115674d583fef46ede80077a2"
                },
                {
                  "fixed": "28dc61cc49c6e995121c6d86bef4b73df78dda80"
                },
                {
                  "fixed": "b5de1eac71fec1af7723f1083d23a24789fd795c"
                },
                {
                  "fixed": "85a5660491b507d33662b8e81c142e6041e642eb"
                },
                {
                  "fixed": "11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "4.9.224"
                },
                {
                  "fixed": "4.9.337"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "3.16.83"
                },
                {
                  "fixed": "3.17"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "4.4.224"
                },
                {
                  "fixed": "4.5"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "f78b54e7d83c7879f9a6e49e6724019ca34177cc"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "d79d7d5c878809964da537336dad5ff55fa1605e"
                }
              ]
            }
          ],
          "versions": [
            "v4.9.336",
            "v4.9.335",
            "v4.9.334",
            "v4.9.333",
            "v4.9.332",
            "v4.9.331",
            "v4.9.330",
            "v4.9.329",
            "v4.9.328",
            "v4.9.327",
            "v4.9.326",
            "v4.9.325",
            "v4.9.324",
            "v4.9.323",
            "v4.9.322",
            "v4.9.321",
            "v4.9.320",
            "v4.9.319",
            "v4.9.318",
            "v4.9.317",
            "v4.9.316",
            "v4.9.315",
            "v4.9.314",
            "v4.9.313",
            "v4.9.312",
            "v4.9.311",
            "v4.9.310",
            "v4.9.309",
            "v4.9.308",
            "v4.9.307",
            "v4.9.306",
            "v4.9.305",
            "v4.9.304",
            "v4.9.303",
            "v4.9.302",
            "v4.9.301",
            "v4.9.300",
            "v4.9.299",
            "v4.9.298",
            "v4.9.297",
            "v4.9.296",
            "v4.9.295",
            "v4.9.294",
            "v4.9.293",
            "v4.9.292",
            "v4.9.291",
            "v4.9.290",
            "v4.9.289",
            "v4.9.288",
            "v4.9.287",
            "v4.9.286",
            "v4.9.285",
            "v4.9.284",
            "v4.9.283",
            "v4.9.282",
            "v4.9.281",
            "v4.9.280",
            "v4.9.279",
            "v4.9.278",
            "v4.9.277",
            "v4.9.276",
            "v4.9.275",
            "v4.9.274",
            "v4.9.273",
            "v4.9.272",
            "v4.9.271",
            "v4.9.270",
            "v4.9.269",
            "v4.9.268",
            "v4.9.267",
            "v4.9.266",
            "v4.9.265",
            "v4.9.264",
            "v4.9.263",
            "v4.9.262",
            "v4.9.261",
            "v4.9.260",
            "v4.9.259",
            "v4.9.258",
            "v4.9.257",
            "v4.9.256",
            "v4.9.255",
            "v4.9.254",
            "v4.9.253",
            "v4.9.252",
            "v4.9.251",
            "v4.9.250",
            "v4.9.249",
            "v4.9.248",
            "v4.9.247",
            "v4.9.246",
            "v4.9.245",
            "v4.9.244",
            "v4.9.243",
            "v4.9.242",
            "v4.9.241",
            "v4.9.240",
            "v4.9.239",
            "v4.9.238",
            "v4.9.237",
            "v4.9.236",
            "v4.9.235",
            "v4.9.234",
            "v4.9.233",
            "v4.9.232",
            "v4.9.231",
            "v4.9.230",
            "v4.9.229",
            "v4.9.228",
            "v4.9.227",
            "v4.9.226",
            "v4.9.225",
            "v4.9.224",
            "v3.16.85",
            "v3.16.84",
            "v3.16.83",
            "v4.4.302",
            "v4.4.301",
            "v4.4.300",
            "v4.4.299",
            "v4.4.298",
            "v4.4.297",
            "v4.4.296",
            "v4.4.295",
            "v4.4.294",
            "v4.4.293",
            "v4.4.292",
            "v4.4.291",
            "v4.4.290",
            "v4.4.289",
            "v4.4.288",
            "v4.4.287",
            "v4.4.286",
            "v4.4.285",
            "v4.4.284",
            "v4.4.283",
            "v4.4.282",
            "v4.4.281",
            "v4.4.280",
            "v4.4.279",
            "v4.4.278",
            "v4.4.277",
            "v4.4.276",
            "v4.4.275",
            "v4.4.274",
            "v4.4.273",
            "v4.4.272",
            "v4.4.271",
            "v4.4.270",
            "v4.4.269",
            "v4.4.268",
            "v4.4.267",
            "v4.4.266",
            "v4.4.265",
            "v4.4.264",
            "v4.4.263",
            "v4.4.262",
            "v4.4.261",
            "v4.4.260",
            "v4.4.259",
            "v4.4.258",
            "v4.4.257",
            "v4.4.256",
            "v4.4.255",
            "v4.4.254",
            "v4.4.253",
            "v4.4.252",
            "v4.4.251",
            "v4.4.250",
            "v4.4.249",
            "v4.4.248",
            "v4.4.247",
            "v4.4.246",
            "v4.4.245",
            "v4.4.244",
            "v4.4.243",
            "v4.4.242",
            "v4.4.241",
            "v4.4.240",
            "v4.4.239",
            "v4.4.238",
            "v4.4.237",
            "v4.4.236",
            "v4.4.235",
            "v4.4.234",
            "v4.4.233",
            "v4.4.232",
            "v4.4.231",
            "v4.4.230",
            "v4.4.229",
            "v4.4.228",
            "v4.4.227",
            "v4.4.226",
            "v4.4.225",
            "v4.4.224"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50282.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "4.9.337"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.10.0"
                },
                {
                  "fixed": "4.14.303"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.12.0"
                },
                {
                  "fixed": "4.19.270"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.15.0"
                },
                {
                  "fixed": "5.4.229"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.20.0"
                },
                {
                  "fixed": "5.10.163"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.15.86"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "6.0.16"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.2"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50282.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:32.747399492Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797",
        "https://git.kernel.org/stable/c/28dc61cc49c6e995121c6d86bef4b73df78dda80",
        "https://git.kernel.org/stable/c/34d17b39bceef25e4cf9805cd59250ae05d0a139",
        "https://git.kernel.org/stable/c/5d2146889fad4cb9e6c13e790d4cfd871486eca8",
        "https://git.kernel.org/stable/c/6acf8597c5b04f455ee0649e11e5f3bcd28f381e",
        "https://git.kernel.org/stable/c/85a5660491b507d33662b8e81c142e6041e642eb",
        "https://git.kernel.org/stable/c/b5de1eac71fec1af7723f1083d23a24789fd795c",
        "https://git.kernel.org/stable/c/c46db6088bccff5115674d583fef46ede80077a2",
        "https://git.kernel.org/stable/c/d85b5247a79355b8432bfd9ac871f96117f750d4",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50282.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-50282",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50282.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-50282",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 499829,
  "published_at": "2025-09-15T14:21:18.658+00:00"
}