{"id":"CVE-2026-139359","state":"PUBLISHED","title":"RDMA/rxe: refuse to destroy a QP with type 2 MWs still bound","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/rxe: refuse to destroy a QP with type 2 MWs still bound\n\nBinding a type 2 memory window takes a reference on the QP:\nrxe_do_bind_mw() does rxe_get(qp) and stores it in mw->qp. That\nreference is released only when the window is invalidated\n(rxe_do_invalidate_mw() on IB_WR_LOCAL_INV) or the window itself is\ndestroyed (rxe_mw_cleanup()).\n\nrxe_qp_chk_destroy() does not account for those references -- it only\nrefuses when qp->mcg_num is non-zero. So an unprivileged user can bind\na type 2 MW to a QP and then destroy the QP while the binding is still\nlive. __rxe_cleanup() cannot drop the QP refcount to zero (the MW still\nholds a reference), hits its -ETIMEDOUT path, and frees the QP anyway;\nmw->qp is left dangling. When the MW is later invalidated or\ndeallocated, rxe_mw_cleanup()/rxe_do_invalidate_mw() do rxe_put(mw->qp)\non the freed struct rxe_qp -- a use-after-free write (refcount_dec, and\ncomplete()/list work if it reaches zero) reachable from userspace.\nIB_WR_BIND_MW is a local operation, so no peer is required.\n\nTrack the number of type 2 MWs bound to a QP and refuse to destroy the\nQP while that count is non-zero, returning -EBUSY exactly as the\nexisting multicast-attachment check does. The window must be\ninvalidated or deallocated, which drops the reference and the count,\nbefore the QP can be destroyed.","publishedAt":"2026-11-30T13:34:01.864Z","updatedAt":"2026-11-30T13:34:01.864Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"695ec92952acc5dbe711f82e13ac24c2f1d808db","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"267e168ef9b4f9d7e4f172432567b1b754b477e2","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"bc9f872d3285c240a4dc18d214d896418356812c","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"3990e21523c0f203bc6d5d9fcf1ad1f3d11857da","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"d6b13ad770812c1fe553a0c4f7b002cee87ba5ba","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"9e61a2ac6590e9c42d2eeef687749781334b300f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/sw/rxe/rxe_mw.c","drivers/infiniband/sw/rxe/rxe_qp.c","drivers/infiniband/sw/rxe/rxe_verbs.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.8","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/sw/rxe/rxe_mw.c","drivers/infiniband/sw/rxe/rxe_qp.c","drivers/infiniband/sw/rxe/rxe_verbs.h"]}],"references":["https://git.kernel.org/stable/c/695ec92952acc5dbe711f82e13ac24c2f1d808db","https://git.kernel.org/stable/c/267e168ef9b4f9d7e4f172432567b1b754b477e2","https://git.kernel.org/stable/c/bc9f872d3285c240a4dc18d214d896418356812c","https://git.kernel.org/stable/c/3990e21523c0f203bc6d5d9fcf1ad1f3d11857da","https://git.kernel.org/stable/c/d6b13ad770812c1fe553a0c4f7b002cee87ba5ba","https://git.kernel.org/stable/c/9e61a2ac6590e9c42d2eeef687749781334b300f"],"weaknesses":[],"ingestedAt":"2026-11-30T13:48:04.491Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139359.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139359","state":"PUBLISHED","datePublished":"2026-11-30T13:34:01.864Z","dateUpdated":"2026-11-30T13:34:01.864Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.929Z"},"containers":{"cna":{"title":"RDMA/rxe: refuse to destroy a QP with type 2 MWs still bound","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/rxe: refuse to destroy a QP with type 2 MWs still bound\n\nBinding a type 2 memory window takes a reference on the QP:\nrxe_do_bind_mw() does rxe_get(qp) and stores it in mw->qp. That\nreference is released only when the window is invalidated\n(rxe_do_invalidate_mw() on IB_WR_LOCAL_INV) or the window itself is\ndestroyed (rxe_mw_cleanup()).\n\nrxe_qp_chk_destroy() does not account for those references -- it only\nrefuses when qp->mcg_num is non-zero. So an unprivileged user can bind\na type 2 MW to a QP and then destroy the QP while the binding is still\nlive. __rxe_cleanup() cannot drop the QP refcount to zero (the MW still\nholds a reference), hits its -ETIMEDOUT path, and frees the QP anyway;\nmw->qp is left dangling. When the MW is later invalidated or\ndeallocated, rxe_mw_cleanup()/rxe_do_invalidate_mw() do rxe_put(mw->qp)\non the freed struct rxe_qp -- a use-after-free write (refcount_dec, and\ncomplete()/list work if it reaches zero) reachable from userspace.\nIB_WR_BIND_MW is a local operation, so no peer is required.\n\nTrack the number of type 2 MWs bound to a QP and refuse to destroy the\nQP while that count is non-zero, returning -EBUSY exactly as the\nexisting multicast-attachment check does. The window must be\ninvalidated or deallocated, which drops the reference and the count,\nbefore the QP can be destroyed."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"695ec92952acc5dbe711f82e13ac24c2f1d808db","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"267e168ef9b4f9d7e4f172432567b1b754b477e2","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"bc9f872d3285c240a4dc18d214d896418356812c","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"3990e21523c0f203bc6d5d9fcf1ad1f3d11857da","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"d6b13ad770812c1fe553a0c4f7b002cee87ba5ba","versionType":"git"},{"version":"8700e3e7c4857d28ebaa824509934556da0b3e76","status":"affected","lessThan":"9e61a2ac6590e9c42d2eeef687749781334b300f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/sw/rxe/rxe_mw.c","drivers/infiniband/sw/rxe/rxe_qp.c","drivers/infiniband/sw/rxe/rxe_verbs.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.8","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/sw/rxe/rxe_mw.c","drivers/infiniband/sw/rxe/rxe_qp.c","drivers/infiniband/sw/rxe/rxe_verbs.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/695ec92952acc5dbe711f82e13ac24c2f1d808db"},{"url":"https://git.kernel.org/stable/c/267e168ef9b4f9d7e4f172432567b1b754b477e2"},{"url":"https://git.kernel.org/stable/c/bc9f872d3285c240a4dc18d214d896418356812c"},{"url":"https://git.kernel.org/stable/c/3990e21523c0f203bc6d5d9fcf1ad1f3d11857da"},{"url":"https://git.kernel.org/stable/c/d6b13ad770812c1fe553a0c4f7b002cee87ba5ba"},{"url":"https://git.kernel.org/stable/c/9e61a2ac6590e9c42d2eeef687749781334b300f"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:34:01.864Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.8","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.8","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.8","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.8","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.8","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.8","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}