{"id":"CVE-2026-89654","aliases":["CVE-2026-89654"],"related":[],"kind":"vulnerability","state":"published","title":"ceph: fix UAF in check_new_map() on session freed during unlock","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nceph: fix UAF in check_new_map() on session freed during unlock\n\ncheck_new_map() iterates mdsc->sessions[] and for each active session\ndrops mdsc->mutex to perform per-session operations.  The forced-close\npath (rank removed from map) correctly takes a reference on s via\nceph_get_mds_session() before releasing mdsc->mutex, but three other\npaths do not:\n\n  Path A (address changed):  mutex_unlock → mutex_lock(&s->s_mutex)\n  Path B (reconnect):        mutex_unlock → send_mds_reconnect(mdsc, s)\n  Path C (active transition): mutex_unlock → mutex_lock(&s->s_mutex)\n\nWithout the extra reference, another thread can acquire mdsc->mutex\nduring the unlock window, call __unregister_session() which drops the\nlast reference on s, and free it.  The original thread then accesses\nfreed memory via s->s_mutex.\n\nFix by adding ceph_get_mds_session(s) before each mutex_unlock and\nceph_put_mds_session(s) after the corresponding mutex_lock, matching\nthe pattern already used in the forced-close path.\n\nRace timeline (Path A):\n\n  Thread A (check_new_map)             Thread B (another map update\n    holds mdsc->mutex                      or session teardown)\n  --------------------------           --------------------------\n  s = mdsc->sessions[i]\n  (refcount == 1, held only by\n   sessions[] array)\n\n  mutex_unlock(&mdsc->mutex)\n                               --->    acquires mdsc->mutex\n                                       __unregister_session(mdsc, s)\n                                         sessions[i] = NULL\n                                         ceph_put_mds_session(s)\n                                           refcount: 1 -> 0\n                                           kfree(s)  <--- freed!\n\n  mutex_lock(&s->s_mutex)\n  UAF on freed s->s_mutex","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nceph: fix UAF in check_new_map() on session freed during unlock\n\ncheck_new_map() iterates mdsc->sessions[] and for each active session\ndrops mdsc->mutex to perform per-session operations.  The forced-close\npath (rank removed from map) correctly takes a reference on s via\nceph_get_mds_session() before releasing mdsc->mutex, but three other\npaths do not:\n\n  Path A (address changed):  mutex_unlock → mutex_lock(&s->s_mutex)\n  Path B (reconnect):        mutex_unlock → send_mds_reconnect(mdsc, s)\n  Path C (active transition): mutex_unlock → mutex_lock(&s->s_mutex)\n\nWithout the extra reference, another thread can acquire mdsc->mutex\nduring the unlock window, call __unregister_session() which drops the\nlast reference on s, and free it.  The original thread then accesses\nfreed memory via s->s_mutex.\n\nFix by adding ceph_get_mds_session(s) before each mutex_unlock and\nceph_put_mds_session(s) after the corresponding mutex_lock, matching\nthe pattern already used in the forced-close path.\n\nRace timeline (Path A):\n\n  Thread A (check_new_map)             Thread B (another map update\n    holds mdsc->mutex                      or session teardown)\n  --------------------------           --------------------------\n  s = mdsc->sessions[i]\n  (refcount == 1, held only by\n   sessions[] array)\n\n  mutex_unlock(&mdsc->mutex)\n                               --->    acquires mdsc->mutex\n                                       __unregister_session(mdsc, s)\n                                         sessions[i] = NULL\n                                         ceph_put_mds_session(s)\n                                           refcount: 1 -> 0\n                                           kfree(s)  <--- freed!\n\n  mutex_lock(&s->s_mutex)\n  UAF on freed s->s_mutex","source":"cvelist"}],"published":"2026-09-11T19:45:44.086Z","modified":"2026-10-30T13:20:24.920Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2f2dc053404febedc9c273452d9d518fb31fde72","fixed":"989343b7ee5b1a08778be0c7c4bf6030d3910807","status":"affected"},{"type":"git","introduced":"2f2dc053404febedc9c273452d9d518fb31fde72","fixed":"352a278d5a1965aae3f817ce5d24a67ee42d45d1","status":"affected"},{"type":"git","introduced":"2f2dc053404febedc9c273452d9d518fb31fde72","fixed":"820871e9dbeecd2533c4c5f5d91878ceaf02324c","status":"affected"},{"type":"git","introduced":"2f2dc053404febedc9c273452d9d518fb31fde72","fixed":"9646dfee880730aae4b379a4b8ee6c88ac735acd","status":"affected"},{"type":"git","introduced":"2f2dc053404febedc9c273452d9d518fb31fde72","fixed":"21d5be092d947f8d83f76f7ebf3989e7e9230a98","status":"affected"},{"type":"git","introduced":"2f2dc053404febedc9c273452d9d518fb31fde72","fixed":"ee611a7509554c4ca1f54f6aefe592fb1df7ea70","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.34","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.34","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.114","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.57","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.2.4","lastAffected":"7.2.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.3","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/989343b7ee5b1a08778be0c7c4bf6030d3910807","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/352a278d5a1965aae3f817ce5d24a67ee42d45d1","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/820871e9dbeecd2533c4c5f5d91878ceaf02324c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9646dfee880730aae4b379a4b8ee6c88ac735acd","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/21d5be092d947f8d83f76f7ebf3989e7e9230a98","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ee611a7509554c4ca1f54f6aefe592fb1df7ea70","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-10-16T19:25:25.205Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-89654","url":"https://www.cve.org/CVERecord?id=CVE-2026-89654","licence":"CVE Terms of Use","modified":"2026-10-30T12:32:33.412Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-89654","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-89654","licence":"Public domain","modified":"2026-10-30T13:20:24.920Z"}],"updatedAt":"2026-11-25T22:59:38.100Z","epss":{"score":0.00721,"percentile":0.49812,"date":"2026-11-30T12:00:22.000Z"}}