projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c874ad8
)
RDMA/siw: Fix potential page_array out of range access
author
Daniil Dulov
<d.dulov@aladdin.ru>
Mon, 27 Feb 2023 09:17:51 +0000
(
01:17
-0800)
committer
Leon Romanovsky
<leon@kernel.org>
Mon, 13 Mar 2023 11:54:49 +0000
(13:54 +0200)
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>
drivers/infiniband/sw/siw/siw_qp_tx.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/infiniband/sw/siw/siw_qp_tx.c
b/drivers/infiniband/sw/siw/siw_qp_tx.c
index 05052b49107f27a46e6374ef486886f071ad92fd..6bb9e9e81ff4cadac29f5e668874c7c406ef39fb 100644
(file)
--- a/
drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/
drivers/infiniband/sw/siw/siw_qp_tx.c
@@
-558,7
+558,7
@@
static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s)
data_len -= plen;
fp_off = 0;
- if (++seg > (int)MAX_ARRAY) {
+ if (++seg >
=
(int)MAX_ARRAY) {
siw_dbg_qp(tx_qp(c_tx), "to many fragments\n");
siw_unmap_pages(iov, kmap_mask, seg-1);
wqe->processed -= c_tx->bytes_unsent;