{"id":"CVE-2026-138992","summary":"nilfs2: fix checkpoint root lifetime on sysfs errors","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix checkpoint root lifetime on sysfs errors\n\nnilfs_find_or_create_root() links a new checkpoint root into the\ncheckpoint tree and drops ns_cptree_lock before creating the root's\nsysfs group.  If nilfs_sysfs_create_snapshot_group() then fails, the\nroot is freed while it is still reachable from ns_cptree, so a\nconcurrent nilfs_lookup_root() can dereference freed memory.\n\nnilfs_sysfs_create_snapshot_group() allocates memory and creates sysfs\nnodes and may sleep, so it cannot run under the ns_cptree_lock spinlock.\nReorder the creation path so that the sysfs group is set up before the\nroot is published: initialize the root, create its sysfs group outside\nthe lock, and only then take ns_cptree_lock to link it into the tree.\nOn sysfs failure the root was never visible and is freed directly; in\nthe unlikely case a root with the same checkpoint number is already\npresent, the sysfs group of the new root is removed before it is freed.\nConcurrent insertions are already serialized by ns_snapshot_mount_mutex,\nso only the race against nilfs_lookup_root() needs to be closed.\n\nBecause kobject_put() does not guarantee that the embedded kobject's\nrelease callback has run by the time it returns\n(CONFIG_DEBUG_KOBJECT_RELEASE defers it), the container must not be\nfreed until the release completes.  Keep that wait_for_completion() of\nsnapshot_kobj_unregister inside the sysfs helpers, so both the creation\nerror path and nilfs_sysfs_delete_snapshot_group() wait for the release\nbefore their callers free the root.","modified":"2026-11-30T15:01:42.450196008Z","published":"2026-11-30T13:26:52.433Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138992.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/10c8dfa785367e99e95dfa7c0a9af91773d55b81"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2cb947450e0e5a88bb6bb5fca6dbfda1910e74b0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/435a2d476c0f1a78eb3eb18af8a86346c3c62ac4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/71ff72d00ce86e0e37849bfd5ac8d0ad996094a9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8dc66d82745384ec4df596aa5a79eccda54b7d83"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ae118e79c6a2b0a29ed6e26516aa2050b61c1492"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b211997e8e76404cd1eeb224afb0e13867642b84"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e9fdf32ad8e44bc40c1ce8cb019e4b9543a82437"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138992.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138992"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf"},{"fixed":"71ff72d00ce86e0e37849bfd5ac8d0ad996094a9"},{"fixed":"10c8dfa785367e99e95dfa7c0a9af91773d55b81"},{"fixed":"8dc66d82745384ec4df596aa5a79eccda54b7d83"},{"fixed":"e9fdf32ad8e44bc40c1ce8cb019e4b9543a82437"},{"fixed":"b211997e8e76404cd1eeb224afb0e13867642b84"},{"fixed":"435a2d476c0f1a78eb3eb18af8a86346c3c62ac4"},{"fixed":"ae118e79c6a2b0a29ed6e26516aa2050b61c1492"},{"fixed":"2cb947450e0e5a88bb6bb5fca6dbfda1910e74b0"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138992.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.17.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138992.json"}}],"schema_version":"1.9.2"}