summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/ucm.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-05-24 12:18:13 +0800
committerAlex Shi <alex.shi@linaro.org>2016-05-24 12:18:13 +0800
commit0a296a966f183e4ef1fcb37940940e8df8c4f258 (patch)
treef3715d78e72389582ce2ad5dc5c59051f1814b4b /drivers/infiniband/core/ucm.c
parent03d8016839b087e141e26472fabcf860bc05cf7d (diff)
parente429f243df2823451c92227317e5fce5f310b674 (diff)
Merge tag 'v4.1.25' into linux-linaro-lsk-v4.1lsk-v4.1-16.05
This is the 4.1.25 stable release
Diffstat (limited to 'drivers/infiniband/core/ucm.c')
-rw-r--r--drivers/infiniband/core/ucm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index f2f63933e8a9..5befec118a18 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -48,6 +48,7 @@
#include <asm/uaccess.h>
+#include <rdma/ib.h>
#include <rdma/ib_cm.h>
#include <rdma/ib_user_cm.h>
#include <rdma/ib_marshall.h>
@@ -1104,6 +1105,9 @@ static ssize_t ib_ucm_write(struct file *filp, const char __user *buf,
struct ib_ucm_cmd_hdr hdr;
ssize_t result;
+ if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
+ return -EACCES;
+
if (len < sizeof(hdr))
return -EINVAL;