GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

CVE-2022-50304 (GCVE-0-2022-50304)

Vulnerability from cvelistv5 – Published: 2025-09-15 14:45 – Updated: 2026-05-11 19:16
VLAI
Title
mtd: core: fix possible resource leak in init_mtd()
Summary
In the Linux kernel, the following vulnerability has been resolved: mtd: core: fix possible resource leak in init_mtd() I got the error report while inject fault in init_mtd(): sysfs: cannot create duplicate filename '/devices/virtual/bdi/mtd-0' Call Trace: <TASK> dump_stack_lvl+0x67/0x83 sysfs_warn_dup+0x60/0x70 sysfs_create_dir_ns+0x109/0x120 kobject_add_internal+0xce/0x2f0 kobject_add+0x98/0x110 device_add+0x179/0xc00 device_create_groups_vargs+0xf4/0x100 device_create+0x7b/0xb0 bdi_register_va.part.13+0x58/0x2d0 bdi_register+0x9b/0xb0 init_mtd+0x62/0x171 [mtd] do_one_initcall+0x6c/0x3c0 do_init_module+0x58/0x222 load_module+0x268e/0x27d0 __do_sys_finit_module+0xd5/0x140 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK> kobject_add_internal failed for mtd-0 with -EEXIST, don't try to register things with the same name in the same directory. Error registering mtd class or bdi: -17 If init_mtdchar() fails in init_mtd(), mtd_bdi will not be unregistered, as a result, we can't load the mtd module again, to fix this by calling bdi_unregister(mtd_bdi) after out_procfs label.
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 445caaa20c4d6da74f426464f90513b81157ad77 , < 78816504100cbd8e6836df9f58cc4fbb8b262f1c (git)
Affected: 445caaa20c4d6da74f426464f90513b81157ad77 , < 26c304a3f136009c5a2a04e2bf3ac6aa25aabcb4 (git)
Affected: 445caaa20c4d6da74f426464f90513b81157ad77 , < 1aadf01e5076b9ab6bf294b9622335c651314895 (git)
guessed Create a notification for this product.
Linux Linux Affected: 4.10
Unaffected: 0 , < 4.10 (semver)
Unaffected: 6.0.16 , ≤ 6.0.* (semver)
Unaffected: 6.1.2 , ≤ 6.1.* (semver)
Unaffected: 6.2 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/mtd/mtdcore.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "78816504100cbd8e6836df9f58cc4fbb8b262f1c",
              "status": "affected",
              "version": "445caaa20c4d6da74f426464f90513b81157ad77",
              "versionType": "git"
            },
            {
              "lessThan": "26c304a3f136009c5a2a04e2bf3ac6aa25aabcb4",
              "status": "affected",
              "version": "445caaa20c4d6da74f426464f90513b81157ad77",
              "versionType": "git"
            },
            {
              "lessThan": "1aadf01e5076b9ab6bf294b9622335c651314895",
              "status": "affected",
              "version": "445caaa20c4d6da74f426464f90513b81157ad77",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/mtd/mtdcore.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.10"
            },
            {
              "lessThan": "4.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.0.*",
              "status": "unaffected",
              "version": "6.0.16",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.2",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0.16",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.2",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.2",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmtd: core: fix possible resource leak in init_mtd()\n\nI got the error report while inject fault in init_mtd():\n\nsysfs: cannot create duplicate filename \u0027/devices/virtual/bdi/mtd-0\u0027\nCall Trace:\n \u003cTASK\u003e\n dump_stack_lvl+0x67/0x83\n sysfs_warn_dup+0x60/0x70\n sysfs_create_dir_ns+0x109/0x120\n kobject_add_internal+0xce/0x2f0\n kobject_add+0x98/0x110\n device_add+0x179/0xc00\n device_create_groups_vargs+0xf4/0x100\n device_create+0x7b/0xb0\n bdi_register_va.part.13+0x58/0x2d0\n bdi_register+0x9b/0xb0\n init_mtd+0x62/0x171 [mtd]\n do_one_initcall+0x6c/0x3c0\n do_init_module+0x58/0x222\n load_module+0x268e/0x27d0\n __do_sys_finit_module+0xd5/0x140\n do_syscall_64+0x37/0x90\n entry_SYSCALL_64_after_hwframe+0x63/0xcd\n \u003c/TASK\u003e\nkobject_add_internal failed for mtd-0 with -EEXIST, don\u0027t try to register\n\tthings with the same name in the same directory.\nError registering mtd class or bdi: -17\n\nIf init_mtdchar() fails in init_mtd(), mtd_bdi will not be unregistered,\nas a result, we can\u0027t load the mtd module again, to fix this by calling\nbdi_unregister(mtd_bdi) after out_procfs label."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-05-11T19:16:43.472Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/78816504100cbd8e6836df9f58cc4fbb8b262f1c"
        },
        {
          "url": "https://git.kernel.org/stable/c/26c304a3f136009c5a2a04e2bf3ac6aa25aabcb4"
        },
        {
          "url": "https://git.kernel.org/stable/c/1aadf01e5076b9ab6bf294b9622335c651314895"
        }
      ],
      "title": "mtd: core: fix possible resource leak in init_mtd()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50304",
    "datePublished": "2025-09-15T14:45:59.614Z",
    "dateReserved": "2025-09-15T14:18:36.812Z",
    "dateUpdated": "2026-05-11T19:16:43.472Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2022-50304",
      "date": "2026-09-15",
      "epss": "0.00154",
      "percentile": "0.04844"
    },
    "microsoft_vex": {
      "current_release_date": "2026-03-31T15:13:50.000Z",
      "cve": "CVE-2022-50304",
      "id": "msrc_CVE-2022-50304",
      "initial_release_date": "2025-09-02T00:00:00.000Z",
      "product_status:known_affected": "3",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "mtd: core: fix possible resource leak in init_mtd()",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2022-50304.json",
      "version": "3"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50304\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-09-15T15:15:41.953\",\"lastModified\":\"2026-06-17T05:23:11.620\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmtd: core: fix possible resource leak in init_mtd()\\n\\nI got the error report while inject fault in init_mtd():\\n\\nsysfs: cannot create duplicate filename \u0027/devices/virtual/bdi/mtd-0\u0027\\nCall Trace:\\n \u003cTASK\u003e\\n dump_stack_lvl+0x67/0x83\\n sysfs_warn_dup+0x60/0x70\\n sysfs_create_dir_ns+0x109/0x120\\n kobject_add_internal+0xce/0x2f0\\n kobject_add+0x98/0x110\\n device_add+0x179/0xc00\\n device_create_groups_vargs+0xf4/0x100\\n device_create+0x7b/0xb0\\n bdi_register_va.part.13+0x58/0x2d0\\n bdi_register+0x9b/0xb0\\n init_mtd+0x62/0x171 [mtd]\\n do_one_initcall+0x6c/0x3c0\\n do_init_module+0x58/0x222\\n load_module+0x268e/0x27d0\\n __do_sys_finit_module+0xd5/0x140\\n do_syscall_64+0x37/0x90\\n entry_SYSCALL_64_after_hwframe+0x63/0xcd\\n \u003c/TASK\u003e\\nkobject_add_internal failed for mtd-0 with -EEXIST, don\u0027t try to register\\n\\tthings with the same name in the same directory.\\nError registering mtd class or bdi: -17\\n\\nIf init_mtdchar() fails in init_mtd(), mtd_bdi will not be unregistered,\\nas a result, we can\u0027t load the mtd module again, to fix this by calling\\nbdi_unregister(mtd_bdi) after out_procfs label.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"drivers/mtd/mtdcore.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"445caaa20c4d6da74f426464f90513b81157ad77\",\"lessThan\":\"78816504100cbd8e6836df9f58cc4fbb8b262f1c\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"445caaa20c4d6da74f426464f90513b81157ad77\",\"lessThan\":\"26c304a3f136009c5a2a04e2bf3ac6aa25aabcb4\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"445caaa20c4d6da74f426464f90513b81157ad77\",\"lessThan\":\"1aadf01e5076b9ab6bf294b9622335c651314895\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"drivers/mtd/mtdcore.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"4.10\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"4.10\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.0.16\",\"lessThanOrEqual\":\"6.0.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.1.2\",\"lessThanOrEqual\":\"6.1.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.2\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-401\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"4.10\",\"versionEndExcluding\":\"6.0.16\",\"matchCriteriaId\":\"A3EF624E-E9CE-49B8-A5E4-45BA8B355B48\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.1\",\"versionEndExcluding\":\"6.1.2\",\"matchCriteriaId\":\"77239F4B-6BB2-4B9E-A654-36A52396116C\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/1aadf01e5076b9ab6bf294b9622335c651314895\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/26c304a3f136009c5a2a04e2bf3ac6aa25aabcb4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/78816504100cbd8e6836df9f58cc4fbb8b262f1c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-06-30T10:37:30+00:00",
      "cve": "CVE-2022-50304",
      "id": "CVE-2022-50304",
      "initial_release_date": "2022-01-01T00:00:00+00:00",
      "product_status:known_affected": "170",
      "product_status:known_not_affected": "104",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: mtd: core: fix possible resource leak in init_mtd()",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2022/cve-2022-50304.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-08-31T01:24:56Z",
      "cve": "CVE-2022-50304",
      "id": "CVE-2022-50304",
      "initial_release_date": "2025-09-15T23:29:28Z",
      "product_status:known_affected": "684",
      "product_status:known_not_affected": "175",
      "product_status:recommended": "23",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2022-50304",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2022-50304.json",
      "version": "25"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…