]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rxe: Fix "Replace mr by rkey in responder resources"
authorBob Pearson <rpearsonhpe@gmail.com>
Mon, 11 Apr 2022 03:06:48 +0000 (22:06 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 12 Apr 2022 14:17:52 +0000 (11:17 -0300)
commit529d98e26bf7bd8a07a8c9691858760d3c51d09f
tree9ab7931cb503f21576a52ac18ebe83ea4fd0497f
parentc02c8228f39a35a18b7da5bed4327a96bdd1c782
RDMA/rxe: Fix "Replace mr by rkey in responder resources"

The referenced commit generates a reference counting error if the rkey has
the same index but the wrong key. In this case the reference taken by
rxe_pool_get_index() is not dropped.

Drop the reference if the keys don't match in rxe_recheck_mr().  Check
that the mw and mr are still valid.

Fixes: 6749bb9c6268 ("RDMA/rxe: Replace mr by rkey in responder resources")
Link: https://lore.kernel.org/r/20220411030647.20011-1-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_resp.c