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

CVE-2022-50140 (GCVE-0-2022-50140)

Vulnerability from cvelistv5 – Published: 2025-06-18 11:03 – Updated: 2026-05-11 19:13
VLAI
Title
memstick/ms_block: Fix a memory leak
Summary
In the Linux kernel, the following vulnerability has been resolved: memstick/ms_block: Fix a memory leak 'erased_blocks_bitmap' is never freed. As it is allocated at the same time as 'used_blocks_bitmap', it is likely that it should be freed also at the same time. Add the corresponding bitmap_free() in msb_data_clear().
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < efd675246aec045507b9425c67b548cc2d782d8f (git)
Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < 37958980eb4cd71ae594ace093c11b6a91e165e8 (git)
Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < 9d8b911fe3c3ed788c66edba7c90e32a4a7a5f53 (git)
Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < 9260a154b3b5e387dbceec7c0ac441470646bc6f (git)
Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < 961d7d12080fe70847f944d656e36cd0dd0214ba (git)
Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < 16e07966638717416abf45393d6a80a5a1034429 (git)
Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < 39be95d1ff7b44c1e969af72ba9da7332dfcc1da (git)
Affected: 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 , < 54eb7a55be6779c4d0c25eaf5056498a28595049 (git)
guessed Create a notification for this product.
Linux Linux Affected: 3.12
Unaffected: 0 , < 3.12 (semver)
Unaffected: 4.14.291 , ≤ 4.14.* (semver)
Unaffected: 4.19.256 , ≤ 4.19.* (semver)
Unaffected: 5.4.211 , ≤ 5.4.* (semver)
Unaffected: 5.10.137 , ≤ 5.10.* (semver)
Unaffected: 5.15.61 , ≤ 5.15.* (semver)
Unaffected: 5.18.18 , ≤ 5.18.* (semver)
Unaffected: 5.19.2 , ≤ 5.19.* (semver)
Unaffected: 6.0 , ≤ * (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/memstick/core/ms_block.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "efd675246aec045507b9425c67b548cc2d782d8f",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            },
            {
              "lessThan": "37958980eb4cd71ae594ace093c11b6a91e165e8",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            },
            {
              "lessThan": "9d8b911fe3c3ed788c66edba7c90e32a4a7a5f53",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            },
            {
              "lessThan": "9260a154b3b5e387dbceec7c0ac441470646bc6f",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            },
            {
              "lessThan": "961d7d12080fe70847f944d656e36cd0dd0214ba",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            },
            {
              "lessThan": "16e07966638717416abf45393d6a80a5a1034429",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            },
            {
              "lessThan": "39be95d1ff7b44c1e969af72ba9da7332dfcc1da",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            },
            {
              "lessThan": "54eb7a55be6779c4d0c25eaf5056498a28595049",
              "status": "affected",
              "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/memstick/core/ms_block.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "3.12"
            },
            {
              "lessThan": "3.12",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.14.*",
              "status": "unaffected",
              "version": "4.14.291",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.256",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.211",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.137",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.61",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.18.*",
              "status": "unaffected",
              "version": "5.18.18",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.19.*",
              "status": "unaffected",
              "version": "5.19.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.0",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.14.291",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.19.256",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.211",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.137",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.61",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.18.18",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.19.2",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0",
                  "versionStartIncluding": "3.12",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmemstick/ms_block: Fix a memory leak\n\n\u0027erased_blocks_bitmap\u0027 is never freed. As it is allocated at the same time\nas \u0027used_blocks_bitmap\u0027, it is likely that it should be freed also at the\nsame time.\n\nAdd the corresponding bitmap_free() in msb_data_clear()."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-05-11T19:13:35.821Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/efd675246aec045507b9425c67b548cc2d782d8f"
        },
        {
          "url": "https://git.kernel.org/stable/c/37958980eb4cd71ae594ace093c11b6a91e165e8"
        },
        {
          "url": "https://git.kernel.org/stable/c/9d8b911fe3c3ed788c66edba7c90e32a4a7a5f53"
        },
        {
          "url": "https://git.kernel.org/stable/c/9260a154b3b5e387dbceec7c0ac441470646bc6f"
        },
        {
          "url": "https://git.kernel.org/stable/c/961d7d12080fe70847f944d656e36cd0dd0214ba"
        },
        {
          "url": "https://git.kernel.org/stable/c/16e07966638717416abf45393d6a80a5a1034429"
        },
        {
          "url": "https://git.kernel.org/stable/c/39be95d1ff7b44c1e969af72ba9da7332dfcc1da"
        },
        {
          "url": "https://git.kernel.org/stable/c/54eb7a55be6779c4d0c25eaf5056498a28595049"
        }
      ],
      "title": "memstick/ms_block: Fix a memory leak",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50140",
    "datePublished": "2025-06-18T11:03:03.027Z",
    "dateReserved": "2025-06-18T10:57:27.423Z",
    "dateUpdated": "2026-05-11T19:13:35.821Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2022-50140",
      "date": "2026-09-19",
      "epss": "0.00189",
      "percentile": "0.08853"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "drivers/memstick/core/ms_block.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "efd675246aec045507b9425c67b548cc2d782d8f",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "37958980eb4cd71ae594ace093c11b6a91e165e8",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "9d8b911fe3c3ed788c66edba7c90e32a4a7a5f53",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "9260a154b3b5e387dbceec7c0ac441470646bc6f",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "961d7d12080fe70847f944d656e36cd0dd0214ba",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "16e07966638717416abf45393d6a80a5a1034429",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "39be95d1ff7b44c1e969af72ba9da7332dfcc1da",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "54eb7a55be6779c4d0c25eaf5056498a28595049",
                    "status": "affected",
                    "version": "0ab30494bc4f3bc1ea4659b7c5d97c5218554a63",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "drivers/memstick/core/ms_block.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "3.12"
                  },
                  {
                    "lessThan": "3.12",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "4.14.*",
                    "status": "unaffected",
                    "version": "4.14.291",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "4.19.*",
                    "status": "unaffected",
                    "version": "4.19.256",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.4.*",
                    "status": "unaffected",
                    "version": "5.4.211",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.10.*",
                    "status": "unaffected",
                    "version": "5.10.137",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.15.*",
                    "status": "unaffected",
                    "version": "5.15.61",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.18.*",
                    "status": "unaffected",
                    "version": "5.18.18",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.19.*",
                    "status": "unaffected",
                    "version": "5.19.2",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.0",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "F6BB493B-6F4D-4080-95E2-CE277937CD80",
                    "versionEndExcluding": "4.14.291",
                    "versionStartIncluding": "3.12",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "6C47CDE3-B039-4AE5-B8E4-1DC820E473FF",
                    "versionEndExcluding": "4.19.256",
                    "versionStartIncluding": "4.15",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "B1C63D19-C08C-4308-A848-B2523C9275BD",
                    "versionEndExcluding": "5.4.211",
                    "versionStartIncluding": "4.20",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "C2BF720F-C5EE-4DE2-9BDF-CE4CFBC767F4",
                    "versionEndExcluding": "5.10.137",
                    "versionStartIncluding": "5.5",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "51861563-7F40-460F-82CD-2D3FBDAD6618",
                    "versionEndExcluding": "5.15.61",
                    "versionStartIncluding": "5.11",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "5B42E453-8837-49D0-A5EF-03F818A6DC11",
                    "versionEndExcluding": "5.18.18",
                    "versionStartIncluding": "5.16",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "A1A2A5A5-4598-4D7E-BA07-4660398D6C8F",
                    "versionEndExcluding": "5.19.2",
                    "versionStartIncluding": "5.19",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmemstick/ms_block: Fix a memory leak\n\n\u0027erased_blocks_bitmap\u0027 is never freed. As it is allocated at the same time\nas \u0027used_blocks_bitmap\u0027, it is likely that it should be freed also at the\nsame time.\n\nAdd the corresponding bitmap_free() in msb_data_clear()."
          },
          {
            "lang": "es",
            "value": "En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: memstick/ms_block: Se corrige una fuga de memoria: la variable \u0027erased_blocks_bitmap\u0027 nunca se libera. Dado que se asigna al mismo tiempo que \u0027used_blocks_bitmap\u0027, es probable que deba liberarse tambi\u00e9n simult\u00e1neamente. Agregue el bitmap_free() correspondiente en msb_data_clear()."
          }
        ],
        "id": "CVE-2022-50140",
        "lastModified": "2026-06-17T05:22:50.387",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 5.5,
                "baseSeverity": "MEDIUM",
                "confidentialityImpact": "NONE",
                "integrityImpact": "NONE",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 3.6,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ]
        },
        "published": "2025-06-18T11:15:43.953",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/16e07966638717416abf45393d6a80a5a1034429"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/37958980eb4cd71ae594ace093c11b6a91e165e8"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/39be95d1ff7b44c1e969af72ba9da7332dfcc1da"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/54eb7a55be6779c4d0c25eaf5056498a28595049"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/9260a154b3b5e387dbceec7c0ac441470646bc6f"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/961d7d12080fe70847f944d656e36cd0dd0214ba"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/9d8b911fe3c3ed788c66edba7c90e32a4a7a5f53"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/efd675246aec045507b9425c67b548cc2d782d8f"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Analyzed",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-401"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    },
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-30T10:13:57+00:00",
      "cve": "CVE-2022-50140",
      "id": "CVE-2022-50140",
      "initial_release_date": "2022-01-01T00:00:00+00:00",
      "product_status:known_not_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: memstick/ms_block: Fix a memory leak",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2022/cve-2022-50140.json",
      "version": "3"
    }
  }
}



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…