IB/mad: fix UAF and double-free in RMPP receive reassembly

Summary

CVECVE-2026-139584
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-11-30 14:19:39 UTC
Updated2026-11-30 14:19:39 UTC
DescriptionIn the Linux kernel, the following vulnerability has been resolved: IB/mad: fix UAF and double-free in RMPP receive reassembly mad_rmpp_recv.state is protected by two locks that do not exclude each other: recv_timeout_handler() (port workqueue) uses agent->lock, continue_rmpp() (CQ softirq) uses rmpp_recv->lock. Nothing serializes the check-then-set sequence on the state word: T1 (CQ softirq) T2 (port workqueue) continue_rmpp() lock(rmpp_recv->lock) state == ACTIVE [passes] recv_timeout_handler() lock(agent->lock) state = TIMEOUT list_del(&rmpp_recv->list) unlock(agent->lock) destroy_rmpp_recv() wait_for_completion() [blocks on T1's ref] state = COMPLETE unlock(rmpp_recv->lock) complete_rmpp() queue cleanup_work (+10s) deref() [unblocks] kfree(rmpp_recv) ib_free_recv_mad(done_wc) +10s: recv_cleanup_handler() runs lock/list_del/destroy on the freed rmpp_recv -> UAF write and double free; nothing can cancel that cleanup_work anymore, the entry is already off agent->rmpp_list. done_wc is also returned to ib_mad_complete_recv() and freed again -> UAF read and double free. Reaching this requires sending MADs to a kernel RMPP agent from the InfiniBand/RoCE fabric: the per-port sa_query agent accepts subnet manager responses whose SLID/GID/TID are not authenticated on the fabric, and legacy user_mad agents registered without IB_USER_MAD_USER_RMPP start reassembly on any incoming RMPP DATA MAD with an attacker-chosen TID, no in-flight send required. The attacker controls segment timing and can run many transactions in parallel (agent->rmpp_list has no cap), so landing the microseconds-wide receive critical section on the 40-second timeout boundary is a matter of patience, not luck. Unify state transitions under rmpp_recv->lock in recv_timeout_handler(), keeping list manipulation under agent->lock (which preserves the agent->lock -> rmpp_recv->lock ordering used by continue_rmpp()). State check/set in both paths is then serialized, so the loser of the race always observes the final state and bails out. recv_cleanup_handler() needs no change: with transitions serialized, a cleanup_work can only be pending after COMPLETE, in which case the timeout handler exits early. The race is as old as the RMPP implementation itself.

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e e936a56c1ab8ba5d07938812b934b8b1d8b56dc7 git Not specified
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e d8ef8b4626d9df682bdb27be8c039f9532f07740 git Not specified
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e bebbe1555677dbfa3542d2d2caa58a9adf4ec859 git Not specified
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e ae817ef1690cadb9bb176a814f6d1d386d0a544e git Not specified
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e 2eab6afb62da0b29b731ee76f07658bda0b1dd19 git Not specified
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e 1391b9d5db622cc883e945cc0b66666f2995bfca git Not specified
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e 9edaa226ea03da865204e67f745ee974806136e3 git Not specified
CNA Linux Linux affected fa619a77046bef30478697aba0553991033afb8e 90e9b6357bec75f627cde1a85b5887215c80aad8 git Not specified
CNA Linux Linux affected 2.6.13 Not specified
CNA Linux Linux unaffected 2.6.13 semver Not specified
CNA Linux Linux unaffected 5.10.275 5.10.* semver Not specified
CNA Linux Linux unaffected 5.15.226 5.15.* semver Not specified
CNA Linux Linux unaffected 6.1.193 6.1.* semver Not specified
CNA Linux Linux unaffected 6.6.163 6.6.* semver Not specified
CNA Linux Linux unaffected 6.12.119 6.12.* semver Not specified
CNA Linux Linux unaffected 6.18.65 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.6 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc1 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/d8ef8b4626d9df682bdb27be8c039f9532f07740 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/ae817ef1690cadb9bb176a814f6d1d386d0a544e 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/2eab6afb62da0b29b731ee76f07658bda0b1dd19 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/9edaa226ea03da865204e67f745ee974806136e3 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/1391b9d5db622cc883e945cc0b66666f2995bfca 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/90e9b6357bec75f627cde1a85b5887215c80aad8 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/e936a56c1ab8ba5d07938812b934b8b1d8b56dc7 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/bebbe1555677dbfa3542d2d2caa58a9adf4ec859 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report