# CVE-2023-53440: nilfs2: fix sysfs interface lifetime

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.16%, higher than 5% of CVEs (2026-12-01)
- Published: 2025-09-18T16:04:17.845Z
- Modified: 2026-08-05T09:14:08.186Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

nilfs2: fix sysfs interface lifetime

The current nilfs2 sysfs support has issues with the timing of creation
and deletion of sysfs entries, potentially leading to null pointer
dereferences, use-after-free, and lockdep warnings.

Some of the sysfs attributes for nilfs2 per-filesystem instance refer to
metadata file "cpfile", "sufile", or "dat", but
nilfs_sysfs_create_device_group that creates those attributes is executed
before the inodes for these metadata files are loaded, and
nilfs_sysfs_delete_device_group which deletes these sysfs entries is
called after releasing their metadata file inodes.

Therefore, access to some of these sysfs attributes may occur outside of
the lifetime of these metadata files, resulting in inode NULL pointer
dereferences or use-after-free.

In addition, the call to nilfs_sysfs_create_device_group() is made during
the locking period of the semaphore "ns_sem" of nilfs object, so the
shrinker call caused by the memory allocation for the sysfs entries, may
derive lock dependencies "ns_sem" -> (shrinker) -> "locks acquired in
nilfs_evict_inode()".

Since nilfs2 may acquire "ns_sem" deep in the call stack holding other
locks via its error handler __nilfs_error(), this causes lockdep to report
circular locking.  This is a false positive and no circular locking
actually occurs as no inodes exist yet when
nilfs_sysfs_create_device_group() is called.  Fortunately, the lockdep
warnings can be resolved by simply moving the call to
nilfs_sysfs_create_device_group() out of "ns_sem".

This fixes these sysfs issues by revising where the device's sysfs
interface is created/deleted and keeping its lifetime within the lifetime
of the metadata files above.

(As written by CVE List.)

## Affected

- Linux Linux: from dd70edbde2627f47df118d899de6bbb55abcfdbf before d20dcec8f326deb77b6688f8441e014045dac457; from dd70edbde2627f47df118d899de6bbb55abcfdbf before 5fe0ea141fbb887d407f1bf572ebf24427480d5c; from dd70edbde2627f47df118d899de6bbb55abcfdbf before 83b16a60e413148685739635901937e2f16a7873; from dd70edbde2627f47df118d899de6bbb55abcfdbf before 3dbee84bf9e3273c4bb9ca6fc18ff22fba23dd24; from dd70edbde2627f47df118d899de6bbb55abcfdbf before d540aea451ab5489777a8156560f1388449b3109; from dd70edbde2627f47df118d899de6bbb55abcfdbf before 1942ccb7d95f287a312fcbabfa8bc9ba501b1953; from dd70edbde2627f47df118d899de6bbb55abcfdbf before daf4eb3a908b108279b60172d2f176e70d2df875; from dd70edbde2627f47df118d899de6bbb55abcfdbf before 42560f9c92cc43dce75dbf06cc0d840dced39b12; 3.17 (not affected: before 3.17; from 4.14.313 up to 4.14.*; from 4.19.281 up to 4.19.*; from 5.4.241 up to 5.4.*; from 5.10.178 up to 5.10.*; from 5.15.107 up to 5.15.*; from 6.1.24 up to 6.1.*; from 6.2.11 up to 6.2.*; from 6.3 up to *)
- linux linux_kernel: from 3.17 before 4.14.313; from 4.15 before 4.19.281; from 4.20 before 5.4.241; from 5.5 before 5.10.178; from 5.11 before 5.15.107; from 5.16 before 6.1.24; from 6.2 before 6.2.11; 6.3

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/d20dcec8f326deb77b6688f8441e014045dac457> (patch)
- <https://git.kernel.org/stable/c/5fe0ea141fbb887d407f1bf572ebf24427480d5c> (patch)
- <https://git.kernel.org/stable/c/83b16a60e413148685739635901937e2f16a7873> (patch)
- <https://git.kernel.org/stable/c/3dbee84bf9e3273c4bb9ca6fc18ff22fba23dd24> (patch)
- <https://git.kernel.org/stable/c/d540aea451ab5489777a8156560f1388449b3109> (patch)
- <https://git.kernel.org/stable/c/1942ccb7d95f287a312fcbabfa8bc9ba501b1953> (patch)
- <https://git.kernel.org/stable/c/daf4eb3a908b108279b60172d2f176e70d2df875> (patch)
- <https://git.kernel.org/stable/c/42560f9c92cc43dce75dbf06cc0d840dced39b12> (patch)

## Sources

- CVE List: [CVE-2023-53440](https://www.cve.org/CVERecord?id=CVE-2023-53440), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2023-53440](https://nvd.nist.gov/vuln/detail/CVE-2023-53440), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2023-53440 · Whole record: https://cve.day/CVE-2023-53440.json · Rebuilt by cve.day 2026-11-25T22:58:34.884Z
