{"id":"CVE-2023-54087","summary":"ubi: Fix possible null-ptr-deref in ubi_free_volume()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nubi: Fix possible null-ptr-deref in ubi_free_volume()\n\nIt willl cause null-ptr-deref in the following case:\n\nuif_init()\n  ubi_add_volume()\n    cdev_add() -\u003e if it fails, call kill_volumes()\n    device_register()\n\nkill_volumes() -\u003e if ubi_add_volume() fails call this function\n  ubi_free_volume()\n    cdev_del()\n    device_unregister() -\u003e trying to delete a not added device,\n\t\t\t   it causes null-ptr-deref\n\nSo in ubi_free_volume(), it delete devices whether they are added\nor not, it will causes null-ptr-deref.\n\nHandle the error case whlie calling ubi_add_volume() to fix this\nproblem. If add volume fails, set the corresponding vol to null,\nso it can not be accessed in kill_volumes() and release the\nresource in ubi_add_volume() error path.","modified":"2026-04-02T09:45:34.237807Z","published":"2025-12-24T13:06:17.555Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/54xxx/CVE-2023-54087.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/234c53e57424992e657e6f4acc00d3df0983176f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2ea7195b195009ecf0046e55361f393ba96d02db"},{"type":"WEB","url":"https://git.kernel.org/stable/c/45b2c5ca4d2edae70f19fdb086bd927840c4c309"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5558bcf1c58720ca6e9d6198d921cb3aa337f038"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5ec4c8aca5a221756a9007deadfea92795319fee"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9eccdb0760cbcb4427b5303a83a3007de998af51"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c15859bfd326c10230f09cb48a17f8a35f190342"},{"type":"WEB","url":"https://git.kernel.org/stable/c/fcbc795abe7897da4b5d2a6ab5010e36774b00c2"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/54xxx/CVE-2023-54087.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-54087"},{"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":"801c135ce73d5df1caf3eca35b66a10824ae0707"},{"fixed":"5558bcf1c58720ca6e9d6198d921cb3aa337f038"},{"fixed":"45b2c5ca4d2edae70f19fdb086bd927840c4c309"},{"fixed":"234c53e57424992e657e6f4acc00d3df0983176f"},{"fixed":"fcbc795abe7897da4b5d2a6ab5010e36774b00c2"},{"fixed":"5ec4c8aca5a221756a9007deadfea92795319fee"},{"fixed":"2ea7195b195009ecf0046e55361f393ba96d02db"},{"fixed":"9eccdb0760cbcb4427b5303a83a3007de998af51"},{"fixed":"c15859bfd326c10230f09cb48a17f8a35f190342"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-54087.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.6.22"},{"fixed":"4.14.308"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.15.0"},{"fixed":"4.19.276"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.20.0"},{"fixed":"5.4.235"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.173"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.100"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.18"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.2.5"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-54087.json"}}],"schema_version":"1.7.5"}