CVE-2026-99757: btrfs: sysfs: restore NOFS context on early return in btrfs_sysfs_add_block_group_type()

Published Nov 20, 2026
·
Updated

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

btrfs: sysfs: restore NOFS context on early return in btrfssysfsaddblockgrouptype()

btrfssysfsaddblockgrouptype() sets up a NOFS context with memallocnofssave() because kobjectadd() performs GFPKERNEL allocations deep in its call chain, and the function may be called while holding a transaction handle or a lock required for a transaction commit, where reclaim could deadlock.

Every other return path of this function calls memallocnofsrestore() except the early return taken when another thread has already created the kobject for the same raid index (this can happen when restriping). Taking that path leaves PFMEMALLOCNOFS set on the calling task, so all subsequent memory allocations performed by that task remain restricted to the NOFS scope, which may lead to unexpected allocation failures or deadlocks later on.

Restore the NOFS context before returning from that path.

Affected Software

3 affected componentsFixes available
linux/kernel>=5.10.0<6.12.118
6.12.118
linux/kernel>=6.13.0<6.18.64
6.18.64
linux/kernel>=6.19.0<7.3.5
7.3.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.118
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.64
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.5
  4. Compensating control

    In btrfs_sysfs_add_block_group_type(), restore the NOFS context with memalloc_nofs_restore() before the early return when another thread has already created the kobject for the same RAID index.

Frequently Asked Questions

1

Under what conditions can this issue occur?

The affected path is reached when btrfs_sysfs_add_block_group_type() finds that another thread has already created the kobject for the same RAID index. The description notes that this can occur during restriping.

2

What is the operational impact if the early-return path is taken?

The calling task retains the PF_MEMALLOC_NOFS state after returning. Its later memory allocations remain restricted to the NOFS scope, which can cause unexpected allocation failures or later deadlocks.

3

Why does this function use a NOFS memory-allocation context?

It uses NOFS because kobject_add() can perform GFP_KERNEL allocations, while the function may run with a transaction handle or a lock needed for transaction commit held. Reclaim in that context could deadlock.

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