From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Andrew Stellman <astellman@stellman-greene.com>,
Zhu Yanjun <zyjzyj2000@gmail.com>,
"yanjun.zhu@linux.dev" <yanjun.zhu@linux.dev>
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-rc] RDMA/rxe: Zero the AtomicETH compare field in fetch-and-add requests
Date: Wed, 25 Nov 2026 18:32:59 -0800 [thread overview]
Message-ID: <2981e641-4f68-421c-b09e-fedc485e9cbb@linux.dev> (raw)
In-Reply-To: <20261125132605.44412-1-astellman@stellman-greene.com>
在 2026/11/25 5:26, Andrew Stellman 写道:
> init_req_packet() fills the AtomicETH compare field for compare-and-swap
> requests but leaves it unwritten for fetch-and-add requests. The field is
> eight bytes in the transmitted packet.
>
> With init_on_alloc=0, all 200 fetch-and-add requests captured between
> two rxe devices had nonzero bytes in that field, including printable
> text. After this change, all 200 had zero there. Compare-and-swap
> requests sent their compare value before and after the change.
>
> Set the unused compare field to zero when constructing fetch-and-add
> requests.
>
> The issue was found by Claude Opus 5.5 while checking rxe for other
> unzeroed memory, as Zhu Yanjun asked in his review of the rxe_mmap_info
> patch. The fix and this changelog were drafted with OpenAI GPT-6
> (Codex) and reviewed by me.
>
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
Thanks a lot. I am fine with this commit.
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Zhu Yanjun
> ---
> A reproducer is available on request.
>
> drivers/infiniband/sw/rxe/rxe_req.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
> index 4f353abd76f5..a1e7fa48c665 100644
> --- a/drivers/infiniband/sw/rxe/rxe_req.c
> +++ b/drivers/infiniband/sw/rxe/rxe_req.c
> @@ -483,6 +483,7 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
> atmeth_set_comp(pkt, ibwr->wr.atomic.compare_add);
> } else {
> atmeth_set_swap_add(pkt, ibwr->wr.atomic.compare_add);
> + atmeth_set_comp(pkt, 0);
> }
> atmeth_set_rkey(pkt, ibwr->wr.atomic.rkey);
> }
prev parent reply other threads:[~2026-11-26 2:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 13:26 [PATCH rdma-rc] RDMA/rxe: Zero the AtomicETH compare field in fetch-and-add requests Andrew Stellman
2026-11-26 2:32 ` Zhu Yanjun [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=2981e641-4f68-421c-b09e-fedc485e9cbb@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=astellman@stellman-greene.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--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