From: Jason Gunthorpe <jgg@nvidia.com>
To: Aurelien DESBRIERES <aurelien@hackers.camp>
Cc: linux-rdma@vger.kernel.org, leon@kernel.org,
haris.iqbal@ionos.com, jinpu.wang@ionos.com,
gregkh@linuxfoundation.org
Subject: Re: [PATCH] RDMA/rtrs-srv: Fix integer underflow in process_read and process_write
Date: Mon, 8 Jun 2026 15:27:19 -0300 [thread overview]
Message-ID: <20260608182719.GA92631@nvidia.com> (raw)
In-Reply-To: <20260608134802.5019-1-aurelien@hackers.camp>
On Mon, Jun 08, 2026 at 03:47:15PM +0200, Aurelien DESBRIERES wrote:
> usr_len is read from a network-supplied message field (le16_to_cpu)
> and used to compute data_len = off - usr_len without validating that
> usr_len <= off. A malicious RDMA client can send usr_len > off causing
> an integer underflow, resulting in data_len wrapping to a huge size_t
> value which is then passed to the rdma_ev callback as a memory length,
> leading to out-of-bounds memory access.
>
> Fix by reading and validating usr_len <= off before rtrs_srv_get_ops_ids()
> in both process_read() and process_write(), ensuring the early return
> path acquires no reference and has no resource leak.
>
> Reported-by: Aurelien DESBRIERES <aurelien@hackers.camp>
> Reviewed-by: Md Haris Iqbal <haris.iqbal@ionos.com>
> Signed-off-by: Aurelien DESBRIERES <aurelien@hackers.camp>
> Assisted-by: Claude <claude-sonnet-4-6>
> Acked-by: Md Haris Iqbal <haris.iqbal@ionos.com>
> ---
> drivers/infiniband/ulp/rtrs/rtrs-srv.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
Applied, thanks
Jason
prev parent reply other threads:[~2026-06-08 18:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 13:47 [PATCH] RDMA/rtrs-srv: Fix integer underflow in process_read and process_write Aurelien DESBRIERES
2026-06-08 14:21 ` Haris Iqbal
2026-06-08 18:27 ` Jason Gunthorpe [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=20260608182719.GA92631@nvidia.com \
--to=jgg@nvidia.com \
--cc=aurelien@hackers.camp \
--cc=gregkh@linuxfoundation.org \
--cc=haris.iqbal@ionos.com \
--cc=jinpu.wang@ionos.com \
--cc=leon@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