CVE-2023-53440

nilfs2: fix sysfs interface lifetime

State
Published
Severity
7.8 High
Published
Sep 18, 2025
Updated
Aug 5, 2026
Reserved
Sep 17, 2025

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux
3.15.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HCISA-ADP

Weaknesses

Affected Products

ProductVersions
LinuxLinux
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before d20dcec8f326deb77b6688f8441e014045dac457Affected
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before 5fe0ea141fbb887d407f1bf572ebf24427480d5cAffected
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before 83b16a60e413148685739635901937e2f16a7873Affected
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before 3dbee84bf9e3273c4bb9ca6fc18ff22fba23dd24Affected
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before d540aea451ab5489777a8156560f1388449b3109Affected
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before 1942ccb7d95f287a312fcbabfa8bc9ba501b1953Affected
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before daf4eb3a908b108279b60172d2f176e70d2df875Affected
  • dd70edbde2627f47df118d899de6bbb55abcfdbf to before 42560f9c92cc43dce75dbf06cc0d840dced39b12Affected
LinuxLinux
  • 3.17Affected
  • before 3.17Not affected
  • 4.14.313 through 4.14.*Not affected
  • 4.19.281 through 4.19.*Not affected
  • 5.4.241 through 5.4.*Not affected
  • 5.10.178 through 5.10.*Not affected
  • 5.15.107 through 5.15.*Not affected
  • 6.1.24 through 6.1.*Not affected
  • 6.2.11 through 6.2.*Not affected
  • 6.3 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.