{
  "id": "CVE-2025-38172",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-38172",
  "published_at": "2025-07-03T08:36:10.334Z",
  "title": "erofs: avoid using multiple devices with different type",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "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.",
  "cwe": "CWE-416",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.8,
    "nvd": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= fb176750266a3d7f42ebdcf28e8ba40350b27847, \u003c 65115472f741ca000d7ea4a5922214f93cd1516e",
          "\u003e= fb176750266a3d7f42ebdcf28e8ba40350b27847, \u003c cd04beb9ce2773a16057248bb4fa424068ae3807",
          "\u003e= fb176750266a3d7f42ebdcf28e8ba40350b27847, \u003c 9748f2f54f66743ac77275c34886a9f890e18409"
        ],
        "fixed_in": [
          "65115472f741ca000d7ea4a5922214f93cd1516e",
          "cd04beb9ce2773a16057248bb4fa424068ae3807",
          "9748f2f54f66743ac77275c34886a9f890e18409"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.12"
        ],
        "fixed_in": [
          "0",
          "6.12.34",
          "6.15.3",
          "6.16"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 65115472f741ca000d7ea4a5922214f93cd1516e or cd04beb9ce2773a16057248bb4fa424068ae3807 or 9748f2f54f66743ac77275c34886a9f890e18409 or later.",
      "Upgrade Linux to 0 or 6.12.34 or 6.15.3 or 6.16 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
