RDMA/siw: Fix potential page_array out of range access
authorDaniil Dulov <d.dulov@aladdin.ru>
Mon, 27 Feb 2023 09:17:51 +0000 (01:17 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:32 +0000 (23:03 +0900)
commit23cc8191255aa77894792a005b7d048ea52bb5ef
treee51b497af22dcd50eae75f3377a2367664e9b946
parentd7c8d32e5d3a496e9537054e28880fff5bdf9ce5
RDMA/siw: Fix potential page_array out of range access

[ Upstream commit 271bfcfb83a9f77cbae3d6e1a16e3c14132922f0 ]

When seg is equal to MAX_ARRAY, the loop should break, otherwise
it will result in out of range access.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Link: https://lore.kernel.org/r/20230227091751.589612-1-d.dulov@aladdin.ru
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/siw/siw_qp_tx.c