Skip to content
Commit 5f0b2a60 authored by Mikhail Malygin's avatar Mikhail Malygin Committed by Jason Gunthorpe
Browse files

RDMA/rxe: Prevent access to wr->next ptr afrer wr is posted to send queue

rxe_post_send_kernel() iterates over linked list of wr's, until the
wr->next ptr is NULL.  However if we've got an interrupt after last wr is
posted, control may be returned to the code after send completion callback
is executed and wr memory is freed.

As a result, wr->next pointer may contain incorrect value leading to
panic. Store the wr->next on the stack before posting it.

Fixes: 8700e3e7 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20200716190340.23453-1-m.malygin@yadro.com


Signed-off-by: default avatarMikhail Malygin <m.malygin@yadro.com>
Signed-off-by: default avatarSergey Kojushev <s.kojushev@yadro.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent eb7f84e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment