diff options
| author | Honggang LI <honggangli@163.com> | 2026-10-02 22:22:50 +0800 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2026-10-15 09:57:44 -0400 |
| commit | 56a27df6cedd4f3918969d61c7b9d3cc177b2d1b (patch) | |
| tree | fddab690f42b48390238c3453395fdd57a9d175f /tools/lib/python | |
| parent | 47a9c0338f2e0d4178d77b0d2f529fe1fde84642 (diff) | |
RDMA/rxe: Fix out-of-range unsigned-to-signed conversion for RDMA message in 2GiB size
When RDMA READ request for 2GiB in single WR, res->read.resid is u32
0x80000000, which is INT_MIN (-2147483648).
payload = min_t(int, res->read.resid, mtu);
The `min_t` function will return -2147483648 for payload. The wrong
size is propagated through call chain, `read_reply` -> `prepare_ack_packet`
-> `rxe_init_packet` -> `alloc_skb` . `alloc_skb` failed because of
invalid size. The passive side failed to emit response packet for RDMA
READ request.
After fixed it, the active side of RDMA READ failed with error code
"IB_WC_LOC_PROT_ERR". When RDMA_READ_RESPONSE_FIRST packet recived by
the active side, `do_read` call `copy_data`. dma->resid is u32 0x80000000.
int resid = dma->resid;
This conversion set resid to -2147483648. `copy_data` abort as length
greater than resid.
RDMA SEND and WRITE 2GiB message works too, after fixed these two bugs.
Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Honggang LI <honggangli@163.com>
Link: https://patch.msgid.link/20261002142250.657151-1-honggangli@163.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
