summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Guralnik <michaelgur@mellanox.com>2020-01-08 20:05:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-14 16:52:56 -0500
commitc12a6cf735493281fb03fdc5b478759c0636a327 (patch)
tree64735eb9e0f81ccd1b706ea708d71de822c0dc60 /include
parente2e2cf6409575098a1e2efbdefb8a051e3c536a7 (diff)
RDMA/uverbs: Verify MR access flags
commit ca95c1411198c2d87217c19d44571052cdc94725 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-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 5608e14e3aad..8d0f447e1faa 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4300,6 +4300,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;
}