{"id":"CVE-2026-139584","state":"PUBLISHED","title":"IB/mad: fix UAF and double-free in RMPP receive reassembly","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nIB/mad: fix UAF and double-free in RMPP receive reassembly\n\nmad_rmpp_recv.state is protected by two locks that do not exclude\neach other: recv_timeout_handler() (port workqueue) uses agent->lock,\ncontinue_rmpp() (CQ softirq) uses rmpp_recv->lock. Nothing serializes\nthe check-then-set sequence on the state word:\n\n  T1 (CQ softirq)              T2 (port workqueue)\n  continue_rmpp()\n    lock(rmpp_recv->lock)\n    state == ACTIVE  [passes]\n                               recv_timeout_handler()\n                                 lock(agent->lock)\n                                 state = TIMEOUT\n                                 list_del(&rmpp_recv->list)\n                                 unlock(agent->lock)\n                                 destroy_rmpp_recv()\n                                   wait_for_completion()\n                                   [blocks on T1's ref]\n    state = COMPLETE\n    unlock(rmpp_recv->lock)\n    complete_rmpp()\n      queue cleanup_work (+10s)\n    deref()\n                               [unblocks]\n                               kfree(rmpp_recv)\n                               ib_free_recv_mad(done_wc)\n\n  +10s: recv_cleanup_handler() runs lock/list_del/destroy on the\n        freed rmpp_recv -> UAF write and double free; nothing can\n        cancel that cleanup_work anymore, the entry is already off\n        agent->rmpp_list. done_wc is also returned to\n        ib_mad_complete_recv() and freed again -> UAF read and\n        double free.\n\nReaching this requires sending MADs to a kernel RMPP agent from the\nInfiniBand/RoCE fabric: the per-port sa_query agent accepts subnet\nmanager responses whose SLID/GID/TID are not authenticated on the\nfabric, and legacy user_mad agents registered without\nIB_USER_MAD_USER_RMPP start reassembly on any incoming RMPP DATA\nMAD with an attacker-chosen TID, no in-flight send required. The\nattacker controls segment timing and can run many transactions in\nparallel (agent->rmpp_list has no cap), so landing the\nmicroseconds-wide receive critical section on the 40-second timeout\nboundary is a matter of patience, not luck.\n\nUnify state transitions under rmpp_recv->lock in\nrecv_timeout_handler(), keeping list manipulation under agent->lock\n(which preserves the agent->lock -> rmpp_recv->lock ordering used\nby continue_rmpp()). State check/set in both paths is then\nserialized, so the loser of the race always observes the final\nstate and bails out. recv_cleanup_handler() needs no change: with\ntransitions serialized, a cleanup_work can only be pending after\nCOMPLETE, in which case the timeout handler exits early.\n\nThe race is as old as the RMPP implementation itself.","publishedAt":"2026-11-30T13:36:06.428Z","updatedAt":"2026-11-30T13:36:06.428Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"e936a56c1ab8ba5d07938812b934b8b1d8b56dc7","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"d8ef8b4626d9df682bdb27be8c039f9532f07740","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"bebbe1555677dbfa3542d2d2caa58a9adf4ec859","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"ae817ef1690cadb9bb176a814f6d1d386d0a544e","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"2eab6afb62da0b29b731ee76f07658bda0b1dd19","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"1391b9d5db622cc883e945cc0b66666f2995bfca","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"9edaa226ea03da865204e67f745ee974806136e3","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"90e9b6357bec75f627cde1a85b5887215c80aad8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/core/mad_rmpp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.13","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","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/core/mad_rmpp.c"]}],"references":["https://git.kernel.org/stable/c/e936a56c1ab8ba5d07938812b934b8b1d8b56dc7","https://git.kernel.org/stable/c/d8ef8b4626d9df682bdb27be8c039f9532f07740","https://git.kernel.org/stable/c/bebbe1555677dbfa3542d2d2caa58a9adf4ec859","https://git.kernel.org/stable/c/ae817ef1690cadb9bb176a814f6d1d386d0a544e","https://git.kernel.org/stable/c/2eab6afb62da0b29b731ee76f07658bda0b1dd19","https://git.kernel.org/stable/c/1391b9d5db622cc883e945cc0b66666f2995bfca","https://git.kernel.org/stable/c/9edaa226ea03da865204e67f745ee974806136e3","https://git.kernel.org/stable/c/90e9b6357bec75f627cde1a85b5887215c80aad8"],"weaknesses":[],"ingestedAt":"2026-11-30T13:52:04.503Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139584.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139584","state":"PUBLISHED","datePublished":"2026-11-30T13:36:06.428Z","dateUpdated":"2026-11-30T13:36:06.428Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.942Z"},"containers":{"cna":{"title":"IB/mad: fix UAF and double-free in RMPP receive reassembly","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nIB/mad: fix UAF and double-free in RMPP receive reassembly\n\nmad_rmpp_recv.state is protected by two locks that do not exclude\neach other: recv_timeout_handler() (port workqueue) uses agent->lock,\ncontinue_rmpp() (CQ softirq) uses rmpp_recv->lock. Nothing serializes\nthe check-then-set sequence on the state word:\n\n  T1 (CQ softirq)              T2 (port workqueue)\n  continue_rmpp()\n    lock(rmpp_recv->lock)\n    state == ACTIVE  [passes]\n                               recv_timeout_handler()\n                                 lock(agent->lock)\n                                 state = TIMEOUT\n                                 list_del(&rmpp_recv->list)\n                                 unlock(agent->lock)\n                                 destroy_rmpp_recv()\n                                   wait_for_completion()\n                                   [blocks on T1's ref]\n    state = COMPLETE\n    unlock(rmpp_recv->lock)\n    complete_rmpp()\n      queue cleanup_work (+10s)\n    deref()\n                               [unblocks]\n                               kfree(rmpp_recv)\n                               ib_free_recv_mad(done_wc)\n\n  +10s: recv_cleanup_handler() runs lock/list_del/destroy on the\n        freed rmpp_recv -> UAF write and double free; nothing can\n        cancel that cleanup_work anymore, the entry is already off\n        agent->rmpp_list. done_wc is also returned to\n        ib_mad_complete_recv() and freed again -> UAF read and\n        double free.\n\nReaching this requires sending MADs to a kernel RMPP agent from the\nInfiniBand/RoCE fabric: the per-port sa_query agent accepts subnet\nmanager responses whose SLID/GID/TID are not authenticated on the\nfabric, and legacy user_mad agents registered without\nIB_USER_MAD_USER_RMPP start reassembly on any incoming RMPP DATA\nMAD with an attacker-chosen TID, no in-flight send required. The\nattacker controls segment timing and can run many transactions in\nparallel (agent->rmpp_list has no cap), so landing the\nmicroseconds-wide receive critical section on the 40-second timeout\nboundary is a matter of patience, not luck.\n\nUnify state transitions under rmpp_recv->lock in\nrecv_timeout_handler(), keeping list manipulation under agent->lock\n(which preserves the agent->lock -> rmpp_recv->lock ordering used\nby continue_rmpp()). State check/set in both paths is then\nserialized, so the loser of the race always observes the final\nstate and bails out. recv_cleanup_handler() needs no change: with\ntransitions serialized, a cleanup_work can only be pending after\nCOMPLETE, in which case the timeout handler exits early.\n\nThe race is as old as the RMPP implementation itself."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"e936a56c1ab8ba5d07938812b934b8b1d8b56dc7","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"d8ef8b4626d9df682bdb27be8c039f9532f07740","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"bebbe1555677dbfa3542d2d2caa58a9adf4ec859","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"ae817ef1690cadb9bb176a814f6d1d386d0a544e","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"2eab6afb62da0b29b731ee76f07658bda0b1dd19","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"1391b9d5db622cc883e945cc0b66666f2995bfca","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"9edaa226ea03da865204e67f745ee974806136e3","versionType":"git"},{"version":"fa619a77046bef30478697aba0553991033afb8e","status":"affected","lessThan":"90e9b6357bec75f627cde1a85b5887215c80aad8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/core/mad_rmpp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.13","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","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/core/mad_rmpp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e936a56c1ab8ba5d07938812b934b8b1d8b56dc7"},{"url":"https://git.kernel.org/stable/c/d8ef8b4626d9df682bdb27be8c039f9532f07740"},{"url":"https://git.kernel.org/stable/c/bebbe1555677dbfa3542d2d2caa58a9adf4ec859"},{"url":"https://git.kernel.org/stable/c/ae817ef1690cadb9bb176a814f6d1d386d0a544e"},{"url":"https://git.kernel.org/stable/c/2eab6afb62da0b29b731ee76f07658bda0b1dd19"},{"url":"https://git.kernel.org/stable/c/1391b9d5db622cc883e945cc0b66666f2995bfca"},{"url":"https://git.kernel.org/stable/c/9edaa226ea03da865204e67f745ee974806136e3"},{"url":"https://git.kernel.org/stable/c/90e9b6357bec75f627cde1a85b5887215c80aad8"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:36:06.428Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.13","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}