CVE-2026-138992: nilfs2: fix checkpoint root lifetime on sysfs errors

Published Nov 30, 2026
·
Updated

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

nilfs2: fix checkpoint root lifetime on sysfs errors

nilfsfindorcreateroot() links a new checkpoint root into the checkpoint tree and drops nscptreelock before creating the root's sysfs group. If nilfssysfscreatesnapshotgroup() then fails, the root is freed while it is still reachable from nscptree, so a concurrent nilfslookuproot() can dereference freed memory.

nilfssysfscreatesnapshotgroup() allocates memory and creates sysfs nodes and may sleep, so it cannot run under the nscptreelock spinlock. Reorder the creation path so that the sysfs group is set up before the root is published: initialize the root, create its sysfs group outside the lock, and only then take nscptreelock to link it into the tree. On sysfs failure the root was never visible and is freed directly; in the unlikely case a root with the same checkpoint number is already present, the sysfs group of the new root is removed before it is freed. Concurrent insertions are already serialized by nssnapshotmountmutex, so only the race against nilfslookuproot() needs to be closed.

Because kobjectput() does not guarantee that the embedded kobject's release callback has run by the time it returns (CONFIGDEBUGKOBJECTRELEASE defers it), the container must not be freed until the release completes. Keep that waitforcompletion() of snapshotkobjunregister inside the sysfs helpers, so both the creation error path and nilfssysfsdeletesnapshotgroup() wait for the release before their callers free the root.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In nilfs_find_or_create_root(), initialize the checkpoint root and create its sysfs group outside ns_cptree_lock before linking the root into the checkpoint tree; ensure the sysfs unregister helpers wait for the kobject release callback to complete before the root is freed.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:26 PM
Data Sourced
via MITRE·01:26 PM
Description

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