IB/qib: fix local access validation for user MRs
PATCH 1/1 IB/qib: fix local access validation for user MRs
Commit 8aac4cc3 ("IB/qib: RCU locking for MR validation") introduced an error that broke user post sends. The proper validation of the MR was lost in the patch.
This patch corrects that validation.
--- drivers/infiniband/hw/qib/qib_keys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/qib/qib_keys.c +2 -2
@@ -186,8 +186,8 @@ int qib_lkey_ok(struct qib_lkey_table *rkt, struct qib_pd *pd, goto bail; off = sge->addr - mr->user_base; -if (unlikely (sge->addr < mr->iova || off + sge->length > mr->length || - (mr->access_flags & acc) ==0 )) +if (unlikely (sge->addr < mr->user_base || off + sge->length > mr->length || + (mr->access_flags & acc) != acc)) goto bail;if (unlikely (!atomic_inc_not_zero (&mr->refcount))) goto bail;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
DQo+IC0JaWYgKHVubGlrZWx5KHNnZS0+YWRkciA8IG1yLT5pb3ZhIHx8IG9mZiArIHNnZS0+bGVu Z3RoID4gbXItPmxlbmd0aCB8fA0KDQpjaGVja3BhdGNoIGhpdHMgdGhpcyBsaW5lLg0KDQpJJ20g c2VuZGluZyBWMi4NCg0KTWlrZQ0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html