Use-After-Free in RDMA Subsystem (rxe_queue_cleanup) - CVE Request
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 2025032355-penniless-ferocious-d459@gregkh
A message that is not in the archive (sent off-list or not yet received): [email protected]
Sorry. Add linux rdma maillist.
Zhu Yanjun
Quoted 82 lines · Zhu Yanjun
Quoted 21 lines · Greg KH
RDMA maintainers on the To: list here, I've bounced the original to them as well.
More comments below:
Quoted 15 lines · On Sun, Mar 23, 2025 at 03:10:28PM +0800, [email protected] wrote:
Dear Linux Kernel Security Team,
I am reporting a security vulnerability in the Linux kernel's RDMA subsystem involving a use-after-free condition. Below are the technical details and proposed fix.
Vulnerability Details
Component: RDMA subsystem (drivers/infiniband/sw/rxe/rxe_queue.c)
Function:rxe_queue_cleanup()(line 195)
Issue: KASAN: slab-use-after-free Read inrxe_queue_cleanup
Kernel Version: 6.13.6 (observed in a QEMU VM with Debian 11x86_64)
Impact: May allow local attackers to escalate privileges or cause denial-of-service (DoS) via uncontrolled memory corruption.
PoC: Generated by Syzkaller. Full report and trigger: https://paste.ubuntu.com/p/tJgC42wDf6/I have attempted to anaylse the root cause, and I find that the
rxe_queue_cleanup()function accessescq->queueafter it has been freed. This occurs when error handling inrxe_cq.cfreescq->queuebut does not set the pointer to NULL, leading to a dangling reference.Attached below is a patch for
drivers/infiniband/sw/rxe/rxe_cq.cto nullify the pointer after freeing:Hi, Liuy22
If I get you correctly, in the function
rxe_create_cq,rxe_cq_from_initfails because the functiondo_mmap_info1062 static int rxe_create_cq(struct
ib_cq*ibcq, const structib_cq_init_attr*attr, 1063 structuverbs_attr_bundle*attrs)
1064 {...
1098
1099 err = rxe_cq_from_init(rxe, cq,attr->cqe,attr->comp_vector, udata, <----This function failed becausedo_mmap_infofailed. 1100 uresp);
1101 if (err) {
1102rxe_dbg_cq(cq, "create cq failed, err = %d\n", err);
1103 gotoerr_cleanup;
1104 }
...1108
err_cleanup:
1109cleanup_err=rxe_cleanup(cq);
1110 if (cleanup_err)
1111rxe_err_cq(cq, "cleanup failed, err = %d\n", cleanup_err);Then
rxe_cleanupis called to clean up cq.Is it correct? Can you share the call trace with us? So we can delve into this problem, discuss this problem, find out the root cause, then fix it.
Thanks a lot.
Zhu Yanjun
Quoted 25 lines
Review line 64
Quoted 13 lines
diff -u
a/drivers/infiniband/sw/rxe/rxe_cq.cb/drivers/infiniband/sw/rxe/rxe_cq.c---a/drivers/infiniband/sw/rxe/rxe_cq.c2025-03-23 10:02:17.436250465 +0800
+++b/drivers/infiniband/sw/rxe/rxe_cq.c2025-03-23 10:02:12.656152582 +0800(quoted diff) +1
-0@@ -59,6 +59,7 @@ if (err) { vfree(cq->queue->buf); kfree(cq->queue); + cq->queue = NULL; return err; }Can you submit this as a proper patch for inclusion in the tree, so that you get proper credit for fixing the issue as well as finding it?
Quoted 3 lines
After applying the patch, the PoC no longer triggers the use-after-free.
I kindly hope that this report is acknowledged as soon as possible, and a CVE ID is assigned for tracking. I also look forward to advice on further steps (e.g., embargo coordination).
This is not how CVE ids are handled, please read our documentation for how that happens (hint, not here.)
thanks,
greg k-h
Signature · 2 lines
Best Regards, Yanjun.Zhu