linux/drivers/infiniband/sw/siw
Jérémy Jean 9ff797e516 RDMA/siw: Bound fragmented header copies by the remaining length
siw_get_hdr() can receive an extended DDP/RDMAP header across more than
one TCP callback. The first callback may receive most of the header,
while the next one still limits the copy to hdrlen - MIN_DDP_HDR instead
of the number of missing bytes. This makes the destination move past the
end of the header and overwrite the receive state, including
fpdu_part_rcvd. A later callback can then use a negative fpdu_part_rcvd
value as a copy offset, which creates an OOB write.

Use the number of header bytes already received when calculating the
next copy length.

Fixes: 754209850d ("RDMA/siw: Always consume all skbuf data in sk_data_ready() upcall.")
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Link: https://patch.msgid.link/20260908085520.1746329-1-Jeremy.Jean@oss.cyber.gouv.fr
Assisted-by: Codex:gpt-6
Acked-by: Bernard Metzler <bernard.metzler@linux.dev>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-09-10 11:15:46 -04:00
..
iwarp.h IB: Use capital "OR" for multiple licenses in SPDX 2023-09-11 14:14:00 +03:00
Kconfig RDMA/siw: use skb_crc32c() instead of __skb_checksum() 2025-05-21 15:40:05 -07:00
Makefile
siw_cm.c RDMA/siw: Clear association under lock if siw_qp_modify fails in siw_accept 2026-09-01 03:33:04 -04:00
siw_cm.h IB: Use capital "OR" for multiple licenses in SPDX 2023-09-11 14:14:00 +03:00
siw_cq.c RDMA: Don't use %pK through printk 2025-04-09 14:30:10 -04:00
siw_main.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
siw_mem.c RDMA/umem: Rename ib_umem_get() to ib_umem_get_va() 2026-05-29 20:19:57 -03:00
siw_mem.h RDMA/siw: use kzalloc_flex 2026-05-18 04:58:42 -04:00
siw_qp_rx.c RDMA/siw: Bound fragmented header copies by the remaining length 2026-09-10 11:15:46 -04:00
siw_qp_tx.c RDMA/siw: Fix the sendmsg byte count in siw_tcp_sendpages 2025-08-05 11:33:10 -03:00
siw_qp.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
siw_verbs.c Merge rdma branch 'for-rc' into 'for-next' 2026-08-18 11:05:13 -03:00
siw_verbs.h IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
siw.h RDMA/siw: use kzalloc_flex 2026-05-18 04:58:42 -04:00