From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796230870; b=dzQA28q+aQSwOGEBuau9WXUrDlADg7GSZ8TzH3tcQhTxl1A4CZpCbaCu7vORkwnTRBsQ Jp02VFNZ40tzFpoPS1BWmHTTEgFDkAlm43X+4FpoKuuvT4kDNDVxyiitw4981N42qLdpm eEMqxksrfb1yp211ExxujHeIZG8FMaZxCfW87R+bFNn9F/PscAXo5jGTg6oKfVg4O/gHt MPKxB+qVvN9+DzcDtl8P2kF7nidJlADQKauXcC0ZvmFmXuYKl2WAsDr/NpovMWs+gYHAY DOYOJaC/+Q8lOMcUQMrvMim1wxbVvFRyKuWVd6QTRbCAs5F87gtfQgzFT3N+rUQjh3A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796230870; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=FCuNBcX3Krz2xO7jnaBjh7fQtD0JPK94ULCfbOTQXqU=; b=KR7vdZSAWAH1s5ors6/zXPfGly4GKh5xTPeEEq7SZfG66GcoEQ2HhtlJo8bfI2O6l8+O //8PTPi6a7ChsV4x7mjaCMAKzF6WNFHykW7OiceMiiwWzoWlm8H52kkDlmaKSXmDQ+64T tzI1ahK60JwPmAPXedskvd+htPWyd73zqCCO/Zvh2cgLUAas3y43KgcFXtVJ3WP0SrJNy bVBF0Au7enVYTnQsP4Z1bHYsij8NEsa6ZDZlcY4zn/aR6FIANCtr6M9JddZVHhy6qbHHx zKELit0pNlszwreQqrrHFLHwgvJfQQ3VgXq8nS17FAsENolfvvzCEX8aq0Y2jatEk1Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=N7BPEipT; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E2DA606A31A for ; Wed, 2 Dec 2026 17:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=N7BPEipT Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BB851F00896; Wed, 2 Dec 2026 17:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796230870; bh=FCuNBcX3Krz2xO7jnaBjh7fQtD0JPK94ULCfbOTQXqU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=N7BPEipT3IvTnrr+F5QjHNz8EW3Rnw4BSWipRadRvLy/GcEZI9K7CprGV6NJnar6w g4OHJJClKKCHmRvd03qPoYgsnJncOcYhdVyYDQ8Q4zvqdg2Kdra+yPlxLiCnu/FD3d 97PmSdeJL31gYG7oLwVLN+iBfR1YmQej7u+PwgFB2NUMiN39DA8abjqkxc5EQUd5KE NarV0YpZCQtppsqWdAtTYCPp6OxreL7L64SWF2IHaQRuVC8BOF4l/GJTPR6edNErvq aGmxX5uC8TRa6ubx94KEAreZTfTYJhtoj4thYjNrNLl0CgxSeGun+6OcCXPhyiSR5C fBKT5wGf4N1Cw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH rdma-next] RDMA/siw: Fix overflow in inline SGE length check Reply-To: sashiko-reviews@lists.linux.dev To: "Andrew Stellman" Cc: linux-rdma@vger.kernel.org In-Reply-To: <20261202165018.50109-1-bugs@stellman-greene.com> References: <20261202165018.50109-1-bugs@stellman-greene.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 17:01:09 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > From: Andrew Stellman >=20 > siw_copy_inline_sgl() keeps a running total of the inline data length in > the int 'bytes'. For each SGE it adds the u32 length to the total first > and only then checks the total against SIW_MAX_INLINE. If the lengths > add up to 2^32 or more, the total wraps around, and if the wrapped total > is small enough, the check passes and memcpy() is called with the full > SGE length to copy into the inline area of the send queue entry. >=20 > A kernel caller that posts an IB_SEND_INLINE work request with SGE > lengths of 16 and 0xfffffff8 gets a total of 8. siw_post_send() > returns 0, and KASAN reports: >=20 > [ 45.087395] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > [ 45.087402] BUG: KASAN: vmalloc-out-of-bounds in siw_copy_inline_sgl.i= sra.0+0xdc/0x1e0 > [ ... ] > before adding it, so the total can't wrap. Such a work request now > fails with -EINVAL instead of being posted. >=20 > Fixes: 303ae1cdfdf7 ("rdma/siw: application interface") > Signed-off-by: Andrew Stellman Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202165018.5010= 9-1-bugs@stellman-greene.com?part=3D1