{"id":"CVE-2026-99521","summary":"rapidio: mport_cdev: fix use-after-free in mport_mm_close()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nrapidio: mport_cdev: fix use-after-free in mport_mm_close()\n\nA use-after-free vulnerability was identified in mport_mm_close() in\ndrivers/rapidio/devices/rio_mport_cdev.c, identical to the pattern\npreviously addressed in dma_req_free().\n\nThis is observable from userspace when an application creates an mmap\nmapping via the RapidIO character device and subsequently unmaps it (or\nterminates, triggering exit_mmap()).  During munmap, mport_mm_close() is\ninvoked and drops the mapping reference via kref_put().\n\nIf kref_put() drops the last reference, mport_release_mapping() is called,\nwhich frees the underlying rio_mport_mapping structure.  The subsequent\nmutex_unlock() then dereferences map-\u003emd to unlock buf_mutex, leading to a\nuse-after-free:\n\n   mport_mm_close()\n     -\u003e mutex_lock(&map-\u003emd-\u003ebuf_mutex);\n     ...\n     -\u003e kref_put(&map-\u003eref, mport_release_mapping); /* map is freed */\n     -\u003e mutex_unlock(&map-\u003emd-\u003ebuf_mutex);          /* UAF: map used */\n\nFix this by caching map-\u003emd before kref_put() and using the cached pointer\nfor mutex unlocking, ensuring that freed memory is not accessed.","modified":"2026-11-19T17:01:26.793210792Z","published":"2026-11-19T14:44:28.194Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99521.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/0f2cd84858e67cf8e02438bf28243bcdc67aa49a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/48157350b24ac0343374ee3fa34188d7ff30be81"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a0aaf59e7a86312c0272e36f19fb507f91405209"},{"type":"WEB","url":"https://git.kernel.org/stable/c/df3008607f2c3343f7ad34001af656a185c123ee"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99521.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99521"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"e8de370188d098bb49483c287b44925957c3c9b6"},{"fixed":"df3008607f2c3343f7ad34001af656a185c123ee"},{"fixed":"48157350b24ac0343374ee3fa34188d7ff30be81"},{"fixed":"a0aaf59e7a86312c0272e36f19fb507f91405209"},{"fixed":"0f2cd84858e67cf8e02438bf28243bcdc67aa49a"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99521.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.6.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.61"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99521.json"}}],"schema_version":"1.9.2"}