mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
RDMA/uverbs: Verify MR access flags
commitca95c14111upstream. Verify that MR access flags that are passed from user are all supported ones, otherwise an error is returned. Fixes:4fca037783("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
14d37518a9
commit
eb22d5e307
@@ -3864,6 +3864,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user