diff options
| author | Youngsung Ahn <ays511.kr@gmail.com> | 2026-10-02 00:24:33 +0900 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2026-10-15 09:57:37 -0400 |
| commit | 47a9c0338f2e0d4178d77b0d2f529fe1fde84642 (patch) | |
| tree | 2e224f80483f64cdf863bf32e9f0cf2e374cfff7 /tools/lib/python | |
| parent | 7797bbb0e86f0062fe58480a0116c86e4ec0d0d1 (diff) | |
RDMA/rxe: validate inline sge_offset in finish_packet() before indexing inline_data[]
For a user QP, rxe_post_send() takes the qp->is_user branch and
never runs init_send_wqe(), so
dma.length/resid/num_sge/cur_sge/sge_offset all come straight from
the mmap'd SQ ring. In the inline send path finish_packet() uses
sge_offset directly as an index:
u8 *tmp = &wqe->dma.inline_data[wqe->dma.sge_offset];
memcpy(payload_addr(pkt), tmp, payload);
inline_data is a flex array whose capacity is qp->sq.max_inline, but
sge_offset is a u32 from user space, so the source pointer is
displaced arbitrarily past the WQE and the memcpy reads out of
bounds.
commit 126c757e4cd4 ("RDMA/rxe: Validate num_sge/cur_sge before indexing wqe->dma.sge[]")
added num_sge/cur_sge checks on the send path but not sge_offset, the
third attacker-controlled index in the same struct.
Read sge_offset once with READ_ONCE() and bound it (and the payload
that follows it) by qp->sq.max_inline before indexing, so the value
that is validated is the value that is used.
Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Youngsung Ahn <ays511.kr@gmail.com>
Link: https://patch.msgid.link/20261001152433.3259573-1-ays511.kr@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
