CVE-2023-53440

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-53440
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-53440.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2023-53440
Downstream
Related
Published
2025-09-18T16:04:17.845Z
Modified
2025-11-28T02:34:04.638685Z
Summary
nilfs2: fix sysfs interface lifetime
Details

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 nilfssysfscreatedevicegroup that creates those attributes is executed before the inodes for these metadata files are loaded, and nilfssysfsdeletedevicegroup 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 nilfssysfscreatedevicegroup() is made during the locking period of the semaphore "nssem" of nilfs object, so the shrinker call caused by the memory allocation for the sysfs entries, may derive lock dependencies "nssem" -> (shrinker) -> "locks acquired in nilfsevictinode()".

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

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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53440.json"
}
References

Affected packages

Git / 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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.17.0
Fixed
4.14.313
Type
ECOSYSTEM
Events
Introduced
4.15.0
Fixed
4.19.281
Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
5.4.241
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.178
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.107
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.24
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.2.11