]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rxe: IB_WR_REG_MR does not capture MR's iova field
authorChuck Lever <chuck.lever@oracle.com>
Sun, 25 Nov 2018 22:13:08 +0000 (17:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jan 2019 08:20:43 +0000 (09:20 +0100)
commit1da48f58a4c6685161efd25478f2dfe145f31c51
tree2e8aac5e0acb8638d29212e5fae06b8a38407e18
parentc5656fd983689e50dc61193ad59bf9f192ac5156
rxe: IB_WR_REG_MR does not capture MR's iova field

[ Upstream commit b024dd0eba6e6d568f69d63c5e3153aba94c23e3 ]

FRWR memory registration is done with a series of calls and WRs.
1. ULP invokes ib_dma_map_sg()
2. ULP invokes ib_map_mr_sg()
3. ULP posts an IB_WR_REG_MR on the Send queue

Step 2 generates an iova. It is permissible for ULPs to change this
iova (with certain restrictions) between steps 2 and 3.

rxe_map_mr_sg captures the MR's iova but later when rxe processes the
REG_MR WR, it ignores the MR's iova field. If a ULP alters the MR's iova
after step 2 but before step 3, rxe never captures that change.

When the remote sends an RDMA Read targeting that MR, rxe looks up the
R_key, but the altered iova does not match the iova stored in the MR,
causing the RDMA Read request to fail.

Reported-by: Anna Schumaker <schumaker.anna@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/rxe/rxe_req.c