GHSA-H3G4-6FR3-Q6J6
Vulnerability from github – Published: 2026-12-03 12:31 – Updated: 2026-12-03 12:31In 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.
{
"affected": [],
"aliases": [
"CVE-2026-142987"
],
"database_specific": {
"cwe_ids": [],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-12-03T10:17:23Z",
"severity": null
},
"details": "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": "GHSA-h3g4-6fr3-q6j6",
"modified": "2026-12-03T12:31:01Z",
"published": "2026-12-03T12:31:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-142987"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/02d11b2e20bbd98b6496458ebc7522f6d429dc36"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/2ef64b32ceb561e85d572ed2b7aaa45d36087f26"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/5c0e66058314fc994feef9e1a1879146ea3698b6"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/94bc557fc0c78e7c148974baf0be33db9b3cbc93"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/efe2605be71f6f22dcdf08fa9a0b1669e41a68d2"
}
],
"schema_version": "1.4.0",
"severity": []
}
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.
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
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.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
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.