Re: [PATCH rdma-next] RDMA/siw: Fix overflow in inline SGE length check

From: Andrew Stellman

Date: Wed Dec 02 2026 - 14:48:36 EST


On Wed, Dec 02, 2026 at 07:18:50PM +0100, Bernard Metzler wrote:
> The bug is that 'bytes' is declared signed while 'core_sge->length'
> is unsigned. Just make it unsigned as well.

Thanks, Bernard. I tried that. With 'bytes' as unsigned int, the same
test (inline SGE lengths 16 and 0xfffffff8) still posted and KASAN still
reported the out-of-bounds write, because the sum wraps to 8. With
'bytes' as u64 it returned -EINVAL and KASAN was quiet, the same as v1.
Would you rather have the u64 version, or keep v1's check before the
addition?

Andrew