From: Bernard Metzler <bernard.metzler@linux.dev>
To: Andrew Stellman <bugs@stellman-greene.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/siw: Fix overflow in inline SGE length check
Date: Fri, 4 Dec 2026 14:29:28 +0100 [thread overview]
Message-ID: <5931a486-88be-4102-8f79-fffc4f74c890@linux.dev> (raw)
In-Reply-To: <20261202194829.5633-1-bugs@stellman-greene.com>
On 02.12.2026 20:48, Andrew Stellman wrote:
> 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
You are right. The overflow may occure when a huge second
SGE comes in. This is all very theoretical for trusted
kernel clients. It cannot happen at all for user land clients,
since inline WR representation is restricted to just one SGE
at the send queue.
I'd prefer to make bytes an unsigned 64. It just looks more
clean to me than substracting and testing before addition.
Thanks,
Bernard.
prev parent reply other threads:[~2026-12-04 13:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 16:50 [PATCH rdma-next] RDMA/siw: Fix overflow in inline SGE length check Andrew Stellman
2026-12-02 17:01 ` sashiko-bot
2026-12-02 18:18 ` Bernard Metzler
2026-12-02 19:48 ` Andrew Stellman
2026-12-04 13:29 ` Bernard Metzler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5931a486-88be-4102-8f79-fffc4f74c890@linux.dev \
--to=bernard.metzler@linux.dev \
--cc=bugs@stellman-greene.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox