From: sashiko-bot@kernel.org
To: lirongqing <lirongqing@baidu.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/mlx5: Restore mr->pi_mr after temporary stack-local assignment
Date: Sat, 19 Sep 2026 10:24:10 +0000 [thread overview]
Message-ID: <20260919102410.8507F1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260919100848.2442-1-lirongqing@baidu.com>
> From: Li RongQing <lirongqing@baidu.com>
>
> In handle_reg_mr_integrity, when mr->pi_mr is NULL (physical-address
> optimization path), the code points mr->pi_mr at a stack-local pa_pi_mr
> so set_pi_umr_wr can read it during this call. The pointer is never
> restored, so after the function returns mr->pi_mr dangles at a freed stack
> frame. A second IB_WR_REG_MR_INTEGRITY posted on the same MR without
> remapping reads the stale pointer and dereferences it.
>
> Save the original pi_mr (captured at function entry) and restore it on
> the out path.
>
> Fixes: 2563e2f30acb ("RDMA/mlx5: Use PA mapping for PI handover")
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260919100848.2442-1-lirongqing@baidu.com?part=1
next prev parent reply other threads:[~2026-09-19 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 10:08 [PATCH] RDMA/mlx5: Restore mr->pi_mr after temporary stack-local assignment lirongqing
2026-09-19 10:24 ` sashiko-bot [this message]
2026-09-28 18:40 ` Leon Romanovsky
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=20260919102410.8507F1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=sashiko-reviews@lists.linux.dev \
/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