{"id":"CVE-2023-53440","summary":"nilfs2: fix sysfs interface lifetime","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix sysfs interface lifetime\n\nThe current nilfs2 sysfs support has issues with the timing of creation\nand deletion of sysfs entries, potentially leading to null pointer\ndereferences, use-after-free, and lockdep warnings.\n\nSome of the sysfs attributes for nilfs2 per-filesystem instance refer to\nmetadata file \"cpfile\", \"sufile\", or \"dat\", but\nnilfs_sysfs_create_device_group that creates those attributes is executed\nbefore the inodes for these metadata files are loaded, and\nnilfs_sysfs_delete_device_group which deletes these sysfs entries is\ncalled after releasing their metadata file inodes.\n\nTherefore, access to some of these sysfs attributes may occur outside of\nthe lifetime of these metadata files, resulting in inode NULL pointer\ndereferences or use-after-free.\n\nIn addition, the call to nilfs_sysfs_create_device_group() is made during\nthe locking period of the semaphore \"ns_sem\" of nilfs object, so the\nshrinker call caused by the memory allocation for the sysfs entries, may\nderive lock dependencies \"ns_sem\" -\u003e (shrinker) -\u003e \"locks acquired in\nnilfs_evict_inode()\".\n\nSince nilfs2 may acquire \"ns_sem\" deep in the call stack holding other\nlocks via its error handler __nilfs_error(), this causes lockdep to report\ncircular locking.  This is a false positive and no circular locking\nactually occurs as no inodes exist yet when\nnilfs_sysfs_create_device_group() is called.  Fortunately, the lockdep\nwarnings can be resolved by simply moving the call to\nnilfs_sysfs_create_device_group() out of \"ns_sem\".\n\nThis fixes these sysfs issues by revising where the device's sysfs\ninterface is created/deleted and keeping its lifetime within the lifetime\nof the metadata files above.","modified":"2026-04-02T09:44:12.869566Z","published":"2025-09-18T16:04:17.845Z","related":["SUSE-SU-2025:03615-1","SUSE-SU-2025:03628-1","SUSE-SU-2025:3716-1","SUSE-SU-2025:3761-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53440.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/1942ccb7d95f287a312fcbabfa8bc9ba501b1953"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3dbee84bf9e3273c4bb9ca6fc18ff22fba23dd24"},{"type":"WEB","url":"https://git.kernel.org/stable/c/42560f9c92cc43dce75dbf06cc0d840dced39b12"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5fe0ea141fbb887d407f1bf572ebf24427480d5c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/83b16a60e413148685739635901937e2f16a7873"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d20dcec8f326deb77b6688f8441e014045dac457"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d540aea451ab5489777a8156560f1388449b3109"},{"type":"WEB","url":"https://git.kernel.org/stable/c/daf4eb3a908b108279b60172d2f176e70d2df875"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53440.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-53440"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"dd70edbde2627f47df118d899de6bbb55abcfdbf"},{"fixed":"d20dcec8f326deb77b6688f8441e014045dac457"},{"fixed":"5fe0ea141fbb887d407f1bf572ebf24427480d5c"},{"fixed":"83b16a60e413148685739635901937e2f16a7873"},{"fixed":"3dbee84bf9e3273c4bb9ca6fc18ff22fba23dd24"},{"fixed":"d540aea451ab5489777a8156560f1388449b3109"},{"fixed":"1942ccb7d95f287a312fcbabfa8bc9ba501b1953"},{"fixed":"daf4eb3a908b108279b60172d2f176e70d2df875"},{"fixed":"42560f9c92cc43dce75dbf06cc0d840dced39b12"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53440.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"}]}