diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2012-09-28 13:33:52 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-10-01 12:59:26 -0400 |
commit | c00aaa1a0221a22153071fcb2f320e2ebaecc2fd (patch) | |
tree | d4d4d23b4dd1529c9315a8914a588c4669ea7c41 /drivers/infiniband | |
parent | e20d583818a5d6fc052e59fe2345d82ffd089462 (diff) |
IB/qib: Fix local access validation for user MRs
Commit 8aac4cc3a9d7 ("IB/qib: RCU locking for MR validation") introduced
a bug that broke user post sends. The proper validation of the MR
was lost in the patch.
This patch corrects that validation.
Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_keys.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c index e9486c74c226..81c7b73695d2 100644 --- a/drivers/infiniband/hw/qib/qib_keys.c +++ b/drivers/infiniband/hw/qib/qib_keys.c | |||
@@ -186,8 +186,9 @@ int qib_lkey_ok(struct qib_lkey_table *rkt, struct qib_pd *pd, | |||
186 | goto bail; | 186 | goto bail; |
187 | 187 | ||
188 | off = sge->addr - mr->user_base; | 188 | off = sge->addr - mr->user_base; |
189 | if (unlikely(sge->addr < mr->iova || off + sge->length > mr->length || | 189 | if (unlikely(sge->addr < mr->user_base || |
190 | (mr->access_flags & acc) == 0)) | 190 | off + sge->length > mr->length || |
191 | (mr->access_flags & acc) != acc)) | ||
191 | goto bail; | 192 | goto bail; |
192 | if (unlikely(!atomic_inc_not_zero(&mr->refcount))) | 193 | if (unlikely(!atomic_inc_not_zero(&mr->refcount))) |
193 | goto bail; | 194 | goto bail; |