]> www.infradead.org Git - users/dwmw2/linux.git/commit
RDMA/rxe: Fix packet length checks
authorBob Pearson <rpearsonhpe@gmail.com>
Wed, 17 May 2023 17:22:42 +0000 (12:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jun 2023 14:02:13 +0000 (16:02 +0200)
commit6e82de15d6225dd64da591b670ad95cfc3b09295
tree0ddb39f8667c3a754bab88bdbb0a0447a3d3cee2
parentcb1461ecf0e0d06e3c29c95d5b34a68c84732cb9
RDMA/rxe: Fix packet length checks

[ Upstream commit 9a3763e87379c97a78b7c6c6f40720b1e877174f ]

In rxe_net.c a received packet, from udp or loopback, is passed to
rxe_rcv() in rxe_recv.c as a udp packet. I.e. skb->data is pointing at the
udp header. But rxe_rcv() makes length checks to verify the packet is long
enough to hold the roce headers as if it were a roce
packet. I.e. skb->data pointing at the bth header. A runt packet would
appear to have 8 more bytes than it actually does which may lead to
incorrect behavior.

This patch calls skb_pull() to adjust the skb to point at the bth header
before calling rxe_rcv() which fixes this error.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20230517172242.1806340-1-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/rxe/rxe_net.c