[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20121004211158.144882730@linuxfoundation.org>
Date: Thu, 4 Oct 2012 14:16:14 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
alan@...rguk.ukuu.org.uk, Dean Luick <dean.luick@...el.com>,
Mike Marciniszyn <mike.marciniszyn@...el.com>,
Roland Dreier <roland@...estorage.com>
Subject: [ 53/56] IB/qib: Fix local access validation for user MRs
3.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <mike.marciniszyn@...el.com>
commit c00aaa1a0221a22153071fcb2f320e2ebaecc2fd upstream.
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@...el.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@...el.com>
Signed-off-by: Roland Dreier <roland@...estorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/infiniband/hw/qib/qib_keys.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- 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 *r
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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists