RDMA/rxe: Make sure requested access is a subset of {mr,mw}->access
authorLi Zhijian <lizhijian@fujitsu.com>
Tue, 27 Sep 2022 05:53:27 +0000 (13:53 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 28 Oct 2022 17:39:47 +0000 (14:39 -0300)
commit875ab4a8d9a7e559c4aaad28f5886d39923301b7
treece79c1123c2ecc760dbcde2618d3b84d60cb6d27
parent63a18baef2653f59a7c5b990283628bd54d062fd
RDMA/rxe: Make sure requested access is a subset of {mr,mw}->access

We should reject the requests with access flags that is not registered by
MR/MW. For example, lookup_mr() should return NULL when requested access
is 0x03 and mr->access is 0x01.

Link: https://lore.kernel.org/r/20220927055337.22630-2-lizhijian@fujitsu.com
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_mr.c
drivers/infiniband/sw/rxe/rxe_mw.c