projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
647bf13
)
RDMA/rxe: Only allow invalidate for appropriate MRs
author
Bob Pearson
<rpearsonhpe@gmail.com>
Tue, 14 Sep 2021 16:42:07 +0000
(11:42 -0500)
committer
Jason Gunthorpe
<jgg@nvidia.com>
Fri, 24 Sep 2021 13:15:00 +0000
(10:15 -0300)
Local and remote invalidate operations are not allowed by IBA for MRs
created by (re)register memory verbs. This patch checks the MR type in
rxe_invalidate_mr().
Link:
https://lore.kernel.org/r/20210914164206.19768-6-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_mr.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/sw/rxe/rxe_mr.c
b/drivers/infiniband/sw/rxe/rxe_mr.c
index 8d658d42abedce78b06cc7c6fab4025a7630483e..53271df10e47ea41ce08c2d0dfb8a4db3cbbc9b1 100644
(file)
--- a/
drivers/infiniband/sw/rxe/rxe_mr.c
+++ b/
drivers/infiniband/sw/rxe/rxe_mr.c
@@
-605,6
+605,12
@@
int rxe_invalidate_mr(struct rxe_qp *qp, u32 rkey)
goto err_drop_ref;
}
+ if (unlikely(mr->type != IB_MR_TYPE_MEM_REG)) {
+ pr_warn("%s: mr->type (%d) is wrong type\n", __func__, mr->type);
+ ret = -EINVAL;
+ goto err_drop_ref;
+ }
+
mr->state = RXE_MR_STATE_FREE;
ret = 0;