summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/infiniband/core/ucma.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/infiniband/core/ucma.c')
-rw-r--r--kernel/drivers/infiniband/core/ucma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/drivers/infiniband/core/ucma.c b/kernel/drivers/infiniband/core/ucma.c
index 8b5a934e1..886f61ea6 100644
--- a/kernel/drivers/infiniband/core/ucma.c
+++ b/kernel/drivers/infiniband/core/ucma.c
@@ -1574,6 +1574,9 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf,
struct rdma_ucm_cmd_hdr hdr;
ssize_t ret;
+ if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
+ return -EACCES;
+
if (len < sizeof(hdr))
return -EINVAL;