summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorMichael Guralnik <michaelgur@mellanox.com>2020-01-08 20:05:35 +0200
committerJason Gunthorpe <jgg@mellanox.com>2020-01-16 15:55:45 -0400
commitca95c1411198c2d87217c19d44571052cdc94725 (patch)
tree8fa71cceb10e27fcf1c0ff72d2a86904f8bfd592 /include/rdma
parenta1123418ba1078037d9fecb72573ff7222dfe201 (diff)
downloadlinux-ca95c1411198c2d87217c19d44571052cdc94725.tar.bz2
RDMA/uverbs: Verify MR access flags
Verify that MR access flags that are passed from user are all supported ones, otherwise an error is returned. Fixes: 4fca03778351 ("IB/uverbs: Move ib_access_flags and ib_read_counters_flags to uapi") Link: https://lore.kernel.org/r/1578506740-22188-6-git-send-email-yishaih@mellanox.com Signed-off-by: Michael Guralnik <michaelgur@mellanox.com> Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index d8031f6f327e..b20b89e93c62 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4310,6 +4310,9 @@ static inline int ib_check_mr_access(int flags)
!(flags & IB_ACCESS_LOCAL_WRITE))
return -EINVAL;
+ if (flags & ~IB_ACCESS_SUPPORTED)
+ return -EINVAL;
+
return 0;
}