Linux Kernel up to 7.4-rc3 f_mass_storage fsg_store_nofua use after free

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
8.0$5k-$25k0.00+

Summaryinfo

A vulnerability was found in Linux Kernel up to 7.4-rc3. It has been rated as very critical. Impacted is the function fsg_store_nofua of the component f_mass_storage. This manipulation of the argument nofua causes use after free. This vulnerability is handled as CVE-2026-142987. The attack can be initiated remotely. There is not any exploit available. Upgrading the affected component is advised.

Detailsinfo

A vulnerability classified as very critical was found in Linux Kernel up to 7.4-rc3. Affected by this vulnerability is the function fsg_store_nofua of the component f_mass_storage. The manipulation of the argument nofua with an unknown input leads to a use after free vulnerability. The CWE definition for the vulnerability is CWE-416. The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. As an impact it is known to affect confidentiality, integrity, and availability. The summary by CVE is:

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.

It is possible to read the advisory at git.kernel.org. This vulnerability is known as CVE-2026-142987 since 12/03/2026. The exploitation appears to be easy. The attack can be launched remotely. The exploitation needs additional levels of successful authentication. It demands that the victim is doing some kind of user interaction. Technical details of the vulnerability are known, but there is no available exploit. The pricing for an exploit might be around USD $5k-$25k at the moment (estimation calculated on 12/03/2026).

Upgrading to version 5.10.276, 5.15.227, 6.12.120, 6.18.66, 7.3.7 or 7.4-rc4 eliminates this vulnerability. Applying the patch 94bc557fc0c78e7c148974baf0be33db9b3cbc93/2ef64b32ceb561e85d572ed2b7aaa45d36087f26/5c0e66058314fc994feef9e1a1879146ea3698b6/efe2605be71f6f22dcdf08fa9a0b1669e41a68d2/450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2 is able to eliminate this problem. The best possible mitigation is suggested to be upgrading to the latest version.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 8.4
VulDB Meta Temp Score: 8.0

VulDB Base Score: 8.4
VulDB Temp Score: 8.0
VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍

Exploitinginfo

Class: Use after free
CWE: CWE-416 / CWE-119
CAPEC: 🔒
ATT&CK: 🔒

Physical: No
Local: No
Remote: Yes

Availability: 🔒
Status: Not defined
Price Prediction: 🔍
Current Price Estimation: 🔒

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔒

Upgrade: Kernel 5.10.276/5.15.227/6.12.120/6.18.66/7.3.7/7.4-rc4
Patch: 94bc557fc0c78e7c148974baf0be33db9b3cbc93/2ef64b32ceb561e85d572ed2b7aaa45d36087f26/5c0e66058314fc994feef9e1a1879146ea3698b6/efe2605be71f6f22dcdf08fa9a0b1669e41a68d2/450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2

Timelineinfo

12/03/2026 Advisory disclosed
12/03/2026 +0 days CVE reserved
12/03/2026 +0 days VulDB entry created
12/03/2026 +0 days VulDB entry last update

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CNA: Linux
CVE: CVE-2026-142987 (🔒)

GCVE (CVE): GCVE-0-2026-142987
GCVE (VulDB): GCVE-100-448651

Entryinfo

Created: 12/03/2026 10:46
Changes: 12/03/2026 10:46 (60)
Complete: 🔍
Cache ID: 216::103

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!