RDMA/erdma: Prevent use-after-free in erdma_accept_newconn()
Subsystems (3)
Cheng Xu
maintainerPATCH 1/1 RDMA/erdma: Prevent use-after-free in erdma_accept_newconn()
After the erdma_cep_put(new_cep) being called, new_cep will be freed, and the following dereference will cause a UAF problem. Fix this issue.
Fixes 920d93eac8b9 ("RDMA/erdma: Add connection management (CM) support")
Signed-off-by Markus Elfring <[email protected]>
Signed-off-by Cheng Xu <[email protected]>
--- drivers/infiniband/hw/erdma/erdma_cm.c | 1 - 1 file changed, 1 deletion(-)
drivers/infiniband/hw/erdma/erdma_cm.c +0 -1
@@ -709,7 +709,6 @@ static void erdma_accept_newconn(struct erdma_cep *cep)erdma_cancel_mpatimer (new_cep);erdma_cep_put (new_cep); - new_cep->sock =NULL ; }if (new_s) {
Signature · 1 line
2.31.1
Quoted 2 lines
After the
erdma_cep_put(new_cep)being called,new_cepwill be freed, and the following dereference will cause a UAF problem. Fix this issue.
* Would a change description be nicer without an abbreviation?
* Will any additional tags become helpful?
+ See also:
https://lore.kernel.org/cocci/[email protected]/ https://sympa.inria.fr/sympa/arc/cocci/2025-03/msg00075.html https://lkml.org/lkml/2025/3/5/1100
Regards,
Markus
Leon Romanovsky
AppliedQuoted 9 lines · Cheng Xu
After the
erdma_cep_put(new_cep)being called,new_cepwill be freed, and the following dereference will cause a UAF problem. Fix this issue.Fixes 920d93eac8b9 ("RDMA/erdma: Add connection management (CM) support")Signed-off-by Markus Elfring <[email protected]>Signed-off-by Cheng Xu <[email protected]>--- drivers/infiniband/hw/erdma/erdma_cm.c | 1 - 1 file changed, 1 deletion(-)
Applied as is.
Thanks