projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0810da
)
IB/ipath: Check reserved memory keys
author
Robert Walsh
<
[email protected]
>
Thu, 15 Mar 2007 21:45:14 +0000
(14:45 -0700)
committer
Roland Dreier
<
[email protected]
>
Thu, 19 Apr 2007 03:21:00 +0000
(20:21 -0700)
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
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/ipath/ipath_keys.c
b/drivers/infiniband/hw/ipath/ipath_keys.c
index c93fa2f7719c32b298eff5fda04035db821f1df0..dd487c100f5ba06865ef0bea3904b05a6520ca0c 100644
(file)
--- 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;