CVE-2025-38172 (GCVE-0-2025-38172)

Vulnerability from cvelistv5 – Published: 2025-07-03 08:36 – Updated: 2026-08-05 12:00
VLAI
Title
erofs: avoid using multiple devices with different type
Summary
In the Linux kernel, the following vulnerability has been resolved: erofs: avoid using multiple devices with different type For multiple devices, both primary and extra devices should be the same type. `erofs_init_device` has already guaranteed that if the primary is a file-backed device, extra devices should also be regular files. However, if the primary is a block device while the extra device is a file-backed device, `erofs_init_device` will get an ENOTBLK, which is not treated as an error in `erofs_fc_get_tree`, and that leads to an UAF: erofs_fc_get_tree get_tree_bdev_flags(erofs_fc_fill_super) erofs_read_superblock erofs_init_device // sbi->dif0 is not inited yet, // return -ENOTBLK deactivate_locked_super free(sbi) if (err is -ENOTBLK) sbi->dif0.file = filp_open() // sbi UAF So if -ENOTBLK is hitted in `erofs_init_device`, it means the primary device must be a block device, and the extra device is not a block device. The error can be converted to -EINVAL.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: fb176750266a3d7f42ebdcf28e8ba40350b27847 , < 65115472f741ca000d7ea4a5922214f93cd1516e (git)
Affected: fb176750266a3d7f42ebdcf28e8ba40350b27847 , < cd04beb9ce2773a16057248bb4fa424068ae3807 (git)
Affected: fb176750266a3d7f42ebdcf28e8ba40350b27847 , < 9748f2f54f66743ac77275c34886a9f890e18409 (git)
Create a notification for this product.
Linux Linux Affected: 6.12
Unaffected: 0 , < 6.12 (semver)
Unaffected: 6.12.34 , ≤ 6.12.* (semver)
Unaffected: 6.15.3 , ≤ 6.15.* (semver)
Unaffected: 6.16 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/erofs/super.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "65115472f741ca000d7ea4a5922214f93cd1516e",
              "status": "affected",
              "version": "fb176750266a3d7f42ebdcf28e8ba40350b27847",
              "versionType": "git"
            },
            {
              "lessThan": "cd04beb9ce2773a16057248bb4fa424068ae3807",
              "status": "affected",
              "version": "fb176750266a3d7f42ebdcf28e8ba40350b27847",
              "versionType": "git"
            },
            {
              "lessThan": "9748f2f54f66743ac77275c34886a9f890e18409",
              "status": "affected",
              "version": "fb176750266a3d7f42ebdcf28e8ba40350b27847",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/erofs/super.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.12"
            },
            {
              "lessThan": "6.12",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.34",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.15.*",
              "status": "unaffected",
              "version": "6.15.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.34",
                  "versionStartIncluding": "6.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15.3",
                  "versionStartIncluding": "6.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16",
                  "versionStartIncluding": "6.12",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nerofs: avoid using multiple devices with different type\n\nFor multiple devices, both primary and extra devices should be the\nsame type. `erofs_init_device` has already guaranteed that if the\nprimary is a file-backed device, extra devices should also be\nregular files.\n\nHowever, if the primary is a block device while the extra device\nis a file-backed device, `erofs_init_device` will get an ENOTBLK,\nwhich is not treated as an error in `erofs_fc_get_tree`, and that\nleads to an UAF:\n\n  erofs_fc_get_tree\n    get_tree_bdev_flags(erofs_fc_fill_super)\n      erofs_read_superblock\n        erofs_init_device  // sbi-\u003edif0 is not inited yet,\n                           // return -ENOTBLK\n      deactivate_locked_super\n        free(sbi)\n    if (err is -ENOTBLK)\n      sbi-\u003edif0.file = filp_open()  // sbi UAF\n\nSo if -ENOTBLK is hitted in `erofs_init_device`, it means the\nprimary device must be a block device, and the extra device\nis not a block device. The error can be converted to -EINVAL."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerability is reached only through the local mount(2)/fsconfig(2)+fsmount(2) filesystem-mount path on an erofs image plus its `device=` parameters; there is no network-facing consumer of this code.\nAC:L - The trigger is fully deterministic \u2014 an erofs image whose on-disk device table count matches the supplied `device=` options, with one such path naming a regular file instead of a block device, reliably yields -ENOTBLK and the use-after-free write on every attempt. Heap reuse of the freed `erofs_sb_info` is attacker-assisted because the free\u2192write window spans an attacker-influenceable `filp_open()` path walk that can be stalled arbitrarily, and the spray runs from the attacker\u0027s own threads.\nPR:N - The attacker needs no account or capability on the target: they only supply the malicious erofs image and/or arrange the `device=` path (which is resolved with symlink following at fill_super time, in directories such as container blob/staging dirs) to be a non-block file, while a privileged mounter \u2014 automounter, container/composefs runtime, or mount helper handling multi-device erofs images \u2014 performs the mount. This matches the kernel CNA treatment of crafted-image mount bugs (e.g. CVE-2025-38204, CVE-2025-38230, CVE-2025-38652).\nUI:R - The flaw only fires when someone mounts the attacker-supplied erofs image with the corresponding `device=` parameters; it cannot be triggered without that mount action.\nS:U - The freed object, the corrupted slab memory, and the resulting crash or escalation are all inside the kernel\u0027s own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `file_inode(sbi-\u003edif0.file)-\u003ei_mode` is read back out of the freed `erofs_sb_info`; if a sprayed object has taken the slot the kernel dereferences an attacker-groomed pointer and reads memory at an attacker-chosen location, and use-after-free of a kmalloc object is generally leverageable into kernel-memory disclosure.\nI:H - `sbi-\u003edif0.file = file` writes a valid kernel `struct file *` at a fixed offset (16) into a freed generic-kmalloc chunk, clobbering whatever live object has been reallocated there \u2014 a classic UAF write primitive that overwrites pointers/state of an unrelated kernel object and is a strong stepping stone to control-flow hijacking.\nA:H - Even without grooming, the UAF read of poisoned/reused memory and the follow-on `get_tree_nodev()` path (which calls `erofs_fc_fill_super()` with `s_fs_info == NULL`, immediately writing through a NULL `sbi`) produce a kernel oops/panic, and the path also leaks a `struct file` reference on every attempt."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:00:03.095Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/65115472f741ca000d7ea4a5922214f93cd1516e"
        },
        {
          "url": "https://git.kernel.org/stable/c/cd04beb9ce2773a16057248bb4fa424068ae3807"
        },
        {
          "url": "https://git.kernel.org/stable/c/9748f2f54f66743ac77275c34886a9f890e18409"
        }
      ],
      "title": "erofs: avoid using multiple devices with different type",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-38172",
    "datePublished": "2025-07-03T08:36:10.334Z",
    "dateReserved": "2025-04-16T04:51:23.991Z",
    "dateUpdated": "2026-08-05T12:00:03.095Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-38172",
      "date": "2026-08-06",
      "epss": "0.00148",
      "percentile": "0.04465"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-38172\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-07-03T09:15:32.910\",\"lastModified\":\"2026-07-30T06:22:56.830\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nerofs: avoid using multiple devices with different type\\n\\nFor multiple devices, both primary and extra devices should be the\\nsame type. `erofs_init_device` has already guaranteed that if the\\nprimary is a file-backed device, extra devices should also be\\nregular files.\\n\\nHowever, if the primary is a block device while the extra device\\nis a file-backed device, `erofs_init_device` will get an ENOTBLK,\\nwhich is not treated as an error in `erofs_fc_get_tree`, and that\\nleads to an UAF:\\n\\n  erofs_fc_get_tree\\n    get_tree_bdev_flags(erofs_fc_fill_super)\\n      erofs_read_superblock\\n        erofs_init_device  // sbi-\u003edif0 is not inited yet,\\n                           // return -ENOTBLK\\n      deactivate_locked_super\\n        free(sbi)\\n    if (err is -ENOTBLK)\\n      sbi-\u003edif0.file = filp_open()  // sbi UAF\\n\\nSo if -ENOTBLK is hitted in `erofs_init_device`, it means the\\nprimary device must be a block device, and the extra device\\nis not a block device. The error can be converted to -EINVAL.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: erofs: evitar el uso de m\u00faltiples dispositivos con diferentes tipos Para m\u00faltiples dispositivos, tanto los dispositivos principales como los adicionales deben ser del mismo tipo. `erofs_init_device` ya ha garantizado que si el principal es un dispositivo respaldado por archivos, los dispositivos adicionales tambi\u00e9n deben ser archivos normales. Sin embargo, si el dispositivo principal es un dispositivo de bloque mientras que el dispositivo adicional es un dispositivo respaldado por archivo, `erofs_init_device` obtendr\u00e1 un ENOTBLK, que no se trata como un error en `erofs_fc_get_tree`, y eso lleva a un UAF: erofs_fc_get_tree get_tree_bdev_flags(erofs_fc_fill_super) erofs_read_superblock erofs_init_device // sbi-\u0026gt;dif0 a\u00fan no se ha inicializado, // return -ENOTBLK deactivate_locked_super free(sbi) if (err is -ENOTBLK) sbi-\u0026gt;dif0.file = filp_open() // sbi UAF Entonces, si se alcanza -ENOTBLK en `erofs_init_device`, significa que el dispositivo principal debe ser un dispositivo de bloque y el dispositivo adicional no es un dispositivo de bloque. El error se puede convertir a -EINVAL.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"fs/erofs/super.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"fb176750266a3d7f42ebdcf28e8ba40350b27847\",\"lessThan\":\"65115472f741ca000d7ea4a5922214f93cd1516e\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"fb176750266a3d7f42ebdcf28e8ba40350b27847\",\"lessThan\":\"cd04beb9ce2773a16057248bb4fa424068ae3807\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"fb176750266a3d7f42ebdcf28e8ba40350b27847\",\"lessThan\":\"9748f2f54f66743ac77275c34886a9f890e18409\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"fs/erofs/super.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"6.12\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"6.12\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.12.34\",\"lessThanOrEqual\":\"6.12.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.15.3\",\"lessThanOrEqual\":\"6.15.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.16\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"REQUIRED\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9},{\"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:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-416\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.12\",\"versionEndExcluding\":\"6.12.34\",\"matchCriteriaId\":\"D349613A-2E37-4539-B97E-D97F5D92A03C\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.13\",\"versionEndExcluding\":\"6.15.3\",\"matchCriteriaId\":\"0541C761-BD5E-4C1A-8432-83B375D7EB92\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/65115472f741ca000d7ea4a5922214f93cd1516e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/9748f2f54f66743ac77275c34886a9f890e18409\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/cd04beb9ce2773a16057248bb4fa424068ae3807\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-07-30T09:13:34+00:00",
      "cve": "CVE-2025-38172",
      "id": "CVE-2025-38172",
      "initial_release_date": "2025-07-03T00:00:00+00:00",
      "product_status:fixed": "616",
      "product_status:known_not_affected": "198",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: Linux kernel erofs: Use-After-Free due to device type mismatch",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-38172.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-07-31T01:12:35Z",
      "cve": "CVE-2025-38172",
      "id": "CVE-2025-38172",
      "initial_release_date": "2025-07-04T23:22:25Z",
      "product_status:first_fixed": "2",
      "product_status:known_not_affected": "416",
      "product_status:recommended": "196",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-38172",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-38172.json",
      "version": "22"
    }
  }
}



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…

Loading…