Skip to content

Commit 8343768

Browse files
hz-chengrleon
authored andcommitted
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: 920d93e ("RDMA/erdma: Add connection management (CM) support") Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 0b27b0e commit 8343768

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

drivers/infiniband/hw/erdma/erdma_cm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,6 @@ static void erdma_accept_newconn(struct erdma_cep *cep)
709709
erdma_cancel_mpatimer(new_cep);
710710

711711
erdma_cep_put(new_cep);
712-
new_cep->sock = NULL;
713712
}
714713

715714
if (new_s) {

0 commit comments

Comments
 (0)