Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=253fb3902008353831525ab711909abdd5ee191f
Commit:     253fb3902008353831525ab711909abdd5ee191f
Parent:     f0810daf74c564a3615eba5002cc11c21a0949ba
Author:     Robert Walsh <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 15 14:45:14 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Wed Apr 18 20:21:00 2007 -0700

    IB/ipath: Check reserved memory keys
    
    Don't let userspace use the direct-physical-map L_key or R_key.
    
    Signed-off-by: Ralph Campbell <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_keys.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c 
b/drivers/infiniband/hw/ipath/ipath_keys.c
index c93fa2f..dd487c1 100644
--- a/drivers/infiniband/hw/ipath/ipath_keys.c
+++ b/drivers/infiniband/hw/ipath/ipath_keys.c
@@ -133,6 +133,12 @@ int ipath_lkey_ok(struct ipath_qp *qp, struct ipath_sge 
*isge,
         * being reversible by calling bus_to_virt().
         */
        if (sge->lkey == 0) {
+               struct ipath_pd *pd = to_ipd(qp->ibqp.pd);
+
+               if (pd->user) {
+                       ret = 0;
+                       goto bail;
+               }
                isge->mr = NULL;
                isge->vaddr = (void *) sge->addr;
                isge->length = sge->length;
@@ -206,6 +212,12 @@ int ipath_rkey_ok(struct ipath_qp *qp, struct 
ipath_sge_state *ss,
         * (see ipath_get_dma_mr and ipath_dma.c).
         */
        if (rkey == 0) {
+               struct ipath_pd *pd = to_ipd(qp->ibqp.pd);
+
+               if (pd->user) {
+                       ret = 0;
+                       goto bail;
+               }
                sge->mr = NULL;
                sge->vaddr = (void *) vaddr;
                sge->length = len;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to