aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1/file_ops.c
diff options
context:
space:
mode:
authorJareer Abdel-Qader <jareer.h.abdel-qader@intel.com>2015-10-26 10:28:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-27 17:19:22 +0900
commit07839049db8e07c1a0ade9a102b2261cd50ac2c1 (patch)
tree331d7135bb404c07856616f5696983f2dcca0185 /drivers/staging/rdma/hfi1/file_ops.c
parentstaging/rdma/hfi1: Add coalescing support for SDMA TX descriptors (diff)
downloadlinux-dev-07839049db8e07c1a0ade9a102b2261cd50ac2c1.tar.xz
linux-dev-07839049db8e07c1a0ade9a102b2261cd50ac2c1.zip
staging/rdma/hfi1: close shared context security hole
Driver does not verify userid for shared context assignments, allowing malicious user access. Reviewed by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Jareer H Abdel-Qader <jareer.h.abdel-qader@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rdma/hfi1/file_ops.c')
-rw-r--r--drivers/staging/rdma/hfi1/file_ops.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c
index cbaf4f734add..955f80dfecf6 100644
--- a/drivers/staging/rdma/hfi1/file_ops.c
+++ b/drivers/staging/rdma/hfi1/file_ops.c
@@ -948,6 +948,7 @@ static int find_shared_ctxt(struct file *fp,
/* Skip ctxt if it doesn't match the requested one */
if (memcmp(uctxt->uuid, uinfo->uuid,
sizeof(uctxt->uuid)) ||
+ uctxt->jkey != generate_jkey(current_uid()) ||
uctxt->subctxt_id != uinfo->subctxt_id ||
uctxt->subctxt_cnt != uinfo->subctxt_cnt)
continue;