From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Tymbark7372 <tymbark7372@proton.me>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"yanjun.zhu@linux.dev" <yanjun.zhu@linux.dev>
Cc: "zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"leonro@nvidia.com" <leonro@nvidia.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 0/4] RDMA/rxe: Fix u64 iova-overflow family in MR/ODP/RESP/MW paths
Date: Thu, 21 May 2026 08:46:07 -0700 [thread overview]
Message-ID: <ac887af5-3d05-4f5b-910b-a2aa68a9cc7a@linux.dev> (raw)
In-Reply-To: <GmtGfyiQI2c4YxeWS7woOgXgSEajslDC8awnuf_4qoOJJqg9XR_fzYq1AbkS9jp10kWIArTMsMRAu7rg9lgK3nKuWILBpSaJhFV7i_0-yXo=@proton.me>
在 2026/5/21 8:39, Tymbark7372 写道:
> This series fixes a family of u64 overflow bugs in the rxe Soft-RoCE
> driver. All four sites share one root cause: addition of an
> attacker-influenced iova/addr (u64) with an attacker-influenced
> length/resid (size_t/u32/int promoted to u64), without overflow
> check, leading to an OOB read/write primitive in the rxe responder
> workqueue.
>
> I originally reported these to security@kernel.org. Jason Gunthorpe
> confirmed that rxe and siw are development-only drivers without
> embargo handling and asked me to send patches publicly, so this
> series follows that direction. security@kernel.org is intentionally
> not in Cc per Jason's instruction.
>
> Patches:
>
> 1/4: rxe_mr.c mr_check_range
> The USER/MEM_REG case computes iova + length and compares to
> mr->ibmr.iova + mr->ibmr.length. Both additions wrap in u64.
> Use check_add_overflow() for both ends.
>
> 2/4: rxe_odp.c rxe_check_pagefault
> Loop condition addr < iova + length wraps when iova is near
> U64_MAX and length is positive. Compute iova_end with
> check_add_overflow() once and use it in the loop condition.
>
> 3/4: rxe_resp.c duplicate_request
> Third clause iova + resid > res->read.va_org + res->read.length
> has u64 wrap on both sides. Use check_add_overflow() for both
> ends. (Site A in check_rkey, also in rxe_resp.c, calls into
> mr_check_range and is closed by patch 1.)
>
> 4/4: rxe_mw.c rxe_check_bind_mw
> Same wrap class as patch 1. Found by sibling-site grep; not on
> the OOB-write path of the three primary bugs but a
> structurally-identical u64 wrap that would let an attacker bind
> a memory window outside its parent MR's range.
>
> Verification:
>
> Each of the three primary sibling triggers (patches 1, 2, 3) has been
> exercised on v7.1.0-rc3 + KASAN in QEMU as the OOB-write case.
> Patches 1 and 3 produce a single-page-fault Oops in rxe_mr_copy after
> the wrap. Patch 2 produces a single-page-fault Oops in
> rxe_odp_mr_copy. All three are triggered by a single ibv_post_send
> from an unprivileged local user with /dev/infiniband/uverbs0 open.
> A working LPE exploit demonstrated end-to-end privilege escalation
> via the rxe_odp path under the verification config (KASAN dev-build,
> selinux=0, nokaslr). Full PoC and writeup were attached to the
> original security@kernel.org submission.
>
> After applying all four patches, the same triggers no longer fire;
> the wrap checks correctly reject the attacker iova. Re-tested in the
> same QEMU+KASAN configuration.
>
> The trigger PoCs are simple libibverbs programs (one per sibling)
> that I am happy to provide on request.
>
> Fixes / stable:
>
> 1/4: Fixes 8700e3e7c485 ("Soft RoCE driver"), v4.8+
> 2/4: Fixes 2fae67ab63db ("RDMA/rxe: Add support for Send/Recv/Write/Read with ODP"), v6.15+
> 3/4: Fixes 8700e3e7c485 ("Soft RoCE driver"), v4.8+
> 4/4: Fixes 8700e3e7c485 ("Soft RoCE driver"), v4.8+
>
> Pre-f04d5b3d916c LTS branches carry the older wrap form
> iova > mr->ibmr.iova + mr->ibmr.length - length
> instead of the current `iova + length > ...` shape. Patches 1, 3, 4
> will need a backport variant for those branches; I can provide on
> request.
>
> Tymbark7372 (4):
> RDMA/rxe: Fix u64 iova+length overflow in mr_check_range
> RDMA/rxe: Fix u64 iova+length overflow in rxe_check_pagefault
> RDMA/rxe: Fix u64 iova+resid overflow in duplicate_request
> RDMA/rxe: Fix u64 addr+length overflow in rxe_check_bind_mw
To be honest, please do not send the commits with the attachment.
Normally, use the command to send several commits: git send-email
001xxx.patch 002xxx.patch 003xxx.patch ... --to xxx --to xxx
Zhu Yanjun
>
> drivers/infiniband/sw/rxe/rxe_mr.c | 12 +++++++++---
> drivers/infiniband/sw/rxe/rxe_odp.c | 10 ++++++++--
> drivers/infiniband/sw/rxe/rxe_resp.c | 11 ++++++++---
> drivers/infiniband/sw/rxe/rxe_mw.c | 11 ++++++++---
> 4 files changed, 33 insertions(+), 11 deletions(-)
>
> --
> Tymbark7372 <tymbark7372@proton.me>
next prev parent reply other threads:[~2026-05-21 15:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 15:39 [PATCH 0/4] RDMA/rxe: Fix u64 iova-overflow family in MR/ODP/RESP/MW paths Tymbark7372
2026-05-21 15:46 ` Zhu Yanjun [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-21 19:44 Tymbark7372
2026-05-22 2:54 ` Zhu Yanjun
2026-05-25 11:15 ` Tymbark7372
2026-05-25 20:54 ` Zhu Yanjun
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=ac887af5-3d05-4f5b-910b-a2aa68a9cc7a@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tymbark7372@proton.me \
--cc=zyjzyj2000@gmail.com \
/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