FKIE_CVE-2026-142987

Vulnerability from fkie_nvd - Published: 2026-12-03 10:17 - Updated: 2026-12-03 10:17
Severity
Summary
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF fsg_store_nofua() syncs the LUN's backing file when switching from async to sync mode: if (!nofua && curlun->nofua) fsg_lun_fsync_sub(curlun); fsg_lun_fsync_sub() dereferences curlun->filp (vfs_fsync(filp)). Unlike every other store that touches the backing file -- fsg_store_ro() and fsg_store_cdrom() (down_read), fsg_store_file() (down_write) -- fsg_store_nofua() holds no filesem while doing so. A concurrent close of the backing file runs under down_write(filesem) and does fput(curlun->filp) in fsg_lun_close() (fsg_store_file() with an empty path, the SCSI START_STOP eject in do_start_stop(), or forced_eject), so it can free the file while fsg_store_nofua() is dereferencing it: BUG: KASAN: slab-use-after-free in vfs_fsync+0x20/0xe0 vfs_fsync+0x20/0xe0 fsg_lun_fsync_sub+0xa0/0xd0 fsg_store_nofua+0x138/0x160 configfs_write_iter+0x1a7/0x250 vfs_write+0x5df/0x940 Allocated by task 3459: fsg_store_file+0x150/0x1f0 configfs_write_iter+0x1a7/0x250 Freed by task 3459: __fput+0x456/0x6c0 __fput_deferred+0x10d/0x330 fsg_store_file+0x9e/0x1f0 configfs_write_iter+0x1a7/0x250 Hold filesem for read around the fsync in fsg_store_nofua() so the backing file cannot be closed underneath it. The lock is only needed when the fsync actually runs, so it is taken only in that branch. Reproduced on a mass_storage gadget over dummy_hcd by writing lun.N/nofua (1 then 0) from one task while another task rewrites and clears lun.N/file.
Impacted products
Vendor Product Version

{
  "affected": [
    {
      "affectedData": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_mass_storage.c",
            "drivers/usb/gadget/function/storage_common.c",
            "drivers/usb/gadget/function/storage_common.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "94bc557fc0c78e7c148974baf0be33db9b3cbc93",
              "status": "affected",
              "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
              "versionType": "git"
            },
            {
              "lessThan": "02d11b2e20bbd98b6496458ebc7522f6d429dc36",
              "status": "affected",
              "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
              "versionType": "git"
            },
            {
              "lessThan": "2ef64b32ceb561e85d572ed2b7aaa45d36087f26",
              "status": "affected",
              "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
              "versionType": "git"
            },
            {
              "lessThan": "5c0e66058314fc994feef9e1a1879146ea3698b6",
              "status": "affected",
              "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
              "versionType": "git"
            },
            {
              "lessThan": "efe2605be71f6f22dcdf08fa9a0b1669e41a68d2",
              "status": "affected",
              "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
              "versionType": "git"
            },
            {
              "lessThan": "450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2",
              "status": "affected",
              "version": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
              "versionType": "git"
            },
            {
              "lessThan": "5.10.276",
              "status": "affected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThan": "5.15.227",
              "status": "affected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThan": "6.12.120",
              "status": "affected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThan": "6.18.66",
              "status": "affected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThan": "7.3.7",
              "status": "affected",
              "version": "0",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_mass_storage.c",
            "drivers/usb/gadget/function/storage_common.c",
            "drivers/usb/gadget/function/storage_common.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.276",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.227",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.120",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.66",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "7.3.*",
              "status": "unaffected",
              "version": "7.3.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.4-rc4",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ],
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF\n\nfsg_store_nofua() syncs the LUN\u0027s backing file when switching from async\nto sync mode:\n\n\tif (!nofua \u0026\u0026 curlun-\u003enofua)\n\t\tfsg_lun_fsync_sub(curlun);\n\nfsg_lun_fsync_sub() dereferences curlun-\u003efilp (vfs_fsync(filp)). Unlike\nevery other store that touches the backing file -- fsg_store_ro() and\nfsg_store_cdrom() (down_read), fsg_store_file() (down_write) --\nfsg_store_nofua() holds no filesem while doing so.\n\nA concurrent close of the backing file runs under down_write(filesem) and\ndoes fput(curlun-\u003efilp) in fsg_lun_close() (fsg_store_file() with an empty\npath, the SCSI START_STOP eject in do_start_stop(), or forced_eject), so\nit can free the file while fsg_store_nofua() is dereferencing it:\n\n\tBUG: KASAN: slab-use-after-free in vfs_fsync+0x20/0xe0\n\t vfs_fsync+0x20/0xe0\n\t fsg_lun_fsync_sub+0xa0/0xd0\n\t fsg_store_nofua+0x138/0x160\n\t configfs_write_iter+0x1a7/0x250\n\t vfs_write+0x5df/0x940\n\tAllocated by task 3459:\n\t fsg_store_file+0x150/0x1f0\n\t configfs_write_iter+0x1a7/0x250\n\tFreed by task 3459:\n\t __fput+0x456/0x6c0\n\t __fput_deferred+0x10d/0x330\n\t fsg_store_file+0x9e/0x1f0\n\t configfs_write_iter+0x1a7/0x250\n\nHold filesem for read around the fsync in fsg_store_nofua() so the backing\nfile cannot be closed underneath it. The lock is only needed when the\nfsync actually runs, so it is taken only in that branch.\n\nReproduced on a mass_storage gadget over dummy_hcd by writing lun.N/nofua\n(1 then 0) from one task while another task rewrites and clears lun.N/file."
    }
  ],
  "id": "CVE-2026-142987",
  "lastModified": "2026-12-03T10:17:23.153",
  "metrics": {},
  "published": "2026-12-03T10:17:23.153",
  "references": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/02d11b2e20bbd98b6496458ebc7522f6d429dc36"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/2ef64b32ceb561e85d572ed2b7aaa45d36087f26"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/5c0e66058314fc994feef9e1a1879146ea3698b6"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/94bc557fc0c78e7c148974baf0be33db9b3cbc93"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/efe2605be71f6f22dcdf08fa9a0b1669e41a68d2"
    }
  ],
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "vulnStatus": "Received"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

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.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    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.