{"id":"CVE-2026-138992","aliases":["CVE-2026-138992"],"related":[],"kind":"vulnerability","state":"published","title":"nilfs2: fix checkpoint root lifetime on sysfs errors","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2026-11-30T13:26:52.433Z","modified":"2026-11-30T14:18:01.897Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"71ff72d00ce86e0e37849bfd5ac8d0ad996094a9","status":"affected"},{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"10c8dfa785367e99e95dfa7c0a9af91773d55b81","status":"affected"},{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"8dc66d82745384ec4df596aa5a79eccda54b7d83","status":"affected"},{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"e9fdf32ad8e44bc40c1ce8cb019e4b9543a82437","status":"affected"},{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"b211997e8e76404cd1eeb224afb0e13867642b84","status":"affected"},{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"435a2d476c0f1a78eb3eb18af8a86346c3c62ac4","status":"affected"},{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"ae118e79c6a2b0a29ed6e26516aa2050b61c1492","status":"affected"},{"type":"git","introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf","fixed":"2cb947450e0e5a88bb6bb5fca6dbfda1910e74b0","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.17","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.17","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/71ff72d00ce86e0e37849bfd5ac8d0ad996094a9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/10c8dfa785367e99e95dfa7c0a9af91773d55b81","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8dc66d82745384ec4df596aa5a79eccda54b7d83","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e9fdf32ad8e44bc40c1ce8cb019e4b9543a82437","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b211997e8e76404cd1eeb224afb0e13867642b84","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/435a2d476c0f1a78eb3eb18af8a86346c3c62ac4","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ae118e79c6a2b0a29ed6e26516aa2050b61c1492","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2cb947450e0e5a88bb6bb5fca6dbfda1910e74b0","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138992","url":"https://www.cve.org/CVERecord?id=CVE-2026-138992","licence":"CVE Terms of Use","modified":"2026-11-30T13:26:52.433Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138992","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138992","licence":"Public domain","modified":"2026-11-30T14:18:01.897Z"}],"updatedAt":"2026-11-30T14:33:06.649Z","epss":{"score":0.00177,"percentile":0.07595,"date":"2026-12-01T12:00:22.000Z"}}