AZL-117881: CVE-2026-142987 affecting package kernel 6.6.161.1-1

Published Dec 3, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

usb: gadget: fmassstorage: take filesem in nofua store to fix backing-file UAF

fsgstorenofua() syncs the LUN's backing file when switching from async to sync mode:

if (!nofua && curlun->nofua) fsglunfsyncsub(curlun);

fsglunfsyncsub() dereferences curlun->filp (vfsfsync(filp)). Unlike every other store that touches the backing file -- fsgstorero() and fsgstorecdrom() (downread), fsgstorefile() (downwrite) -- fsgstorenofua() holds no filesem while doing so.

A concurrent close of the backing file runs under downwrite(filesem) and does fput(curlun->filp) in fsglunclose() (fsgstorefile() with an empty path, the SCSI STARTSTOP eject in dostartstop(), or forcedeject), so it can free the file while fsgstorenofua() is dereferencing it:

BUG: KASAN: slab-use-after-free in vfsfsync+0x20/0xe0 vfsfsync+0x20/0xe0 fsglunfsyncsub+0xa0/0xd0 fsgstorenofua+0x138/0x160 configfswriteiter+0x1a7/0x250 vfswrite+0x5df/0x940 Allocated by task 3459: fsgstorefile+0x150/0x1f0 configfswriteiter+0x1a7/0x250 Freed by task 3459: fput+0x456/0x6c0 fputdeferred+0x10d/0x330 fsgstorefile+0x9e/0x1f0 configfswriteiter+0x1a7/0x250

Hold filesem for read around the fsync in fsgstorenofua() 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 massstorage gadget over dummyhcd by writing lun.N/nofua (1 then 0) from one task while another task rewrites and clears lun.N/file.

Affected Software

1 affected component
azure-linux/kernel<=6.6.161.1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In fsg_store_nofua(), hold filesem for read around the fsync so the backing file cannot be closed while it is being accessed.

Event History

Dec 3, 2026
Advisory Published
via OSV·10:17 AM
Data Sourced
via OSV·10:17 AM
DescriptionAffected Software

Child vulnerabilities

Contains the following vulnerabilities.

Frequently Asked Questions

1

What conditions are required to trigger this issue?

The system must be using the USB gadget mass-storage function with a LUN backed by a file. A concurrent operation must close or eject that backing file while another operation changes the nofua setting from asynchronous to synchronous mode, causing a sync of the file.

2

Which operations can race with the nofua setting change?

Closing the backing file through an empty-path write to the file attribute, a SCSI START_STOP eject operation, or a forced eject can free the backing file while the nofua store handler is using it. The resulting condition is a use-after-free during vfs_fsync.

3

Is the vulnerable behavior limited to a particular backing-file configuration?

The described race applies when a mass-storage LUN has a backing file and its nofua setting is switched from async to sync mode. The provided data does not establish whether the USB gadget mass-storage function or this configuration is enabled by default.

4

What can be done if the updated kernel cannot be deployed immediately?

Avoid changing the nofua setting from asynchronous to synchronous mode while the LUN backing file might be closed or ejected. Serialize those configuration and eject/close operations so the backing file cannot be released during the nofua update.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203