From: Leon Romanovsky <leon@kernel.org>
To: linux-rdma@vger.kernel.org, Dairui Zhang <zhangdairui@gmail.com>
Cc: security@kernel.org, Jason Gunthorpe <jgg@ziepe.ca>,
stable@vger.kernel.org
Subject: Re: [PATCH] IB/mad: fix UAF and double-free in RMPP receive reassembly
Date: Tue, 29 Sep 2026 09:29:01 -0400 [thread overview]
Message-ID: <179068854196.3965508.17242912342114946649.b4-ty@kernel.org> (raw)
In-Reply-To: <20260922152342.1474845-1-zhangdairui@gmail.com>
On Tue, 22 Sep 2026 23:23:42 +0800, Dairui Zhang wrote:
> mad_rmpp_recv.state is protected by two locks that do not exclude
> each other: recv_timeout_handler() (port workqueue) uses agent->lock,
> continue_rmpp() (CQ softirq) uses rmpp_recv->lock. Nothing serializes
> the check-then-set sequence on the state word:
>
> T1 (CQ softirq) T2 (port workqueue)
> continue_rmpp()
> lock(rmpp_recv->lock)
> state == ACTIVE [passes]
> recv_timeout_handler()
> lock(agent->lock)
> state = TIMEOUT
> list_del(&rmpp_recv->list)
> unlock(agent->lock)
> destroy_rmpp_recv()
> wait_for_completion()
> [blocks on T1's ref]
> state = COMPLETE
> unlock(rmpp_recv->lock)
> complete_rmpp()
> queue cleanup_work (+10s)
> deref()
> [unblocks]
> kfree(rmpp_recv)
> ib_free_recv_mad(done_wc)
>
> [...]
Applied, thanks!
[1/1] IB/mad: fix UAF and double-free in RMPP receive reassembly
https://git.kernel.org/rdma/rdma/c/90e9b6357bec75
Best regards,
--
Leon Romanovsky <leon@kernel.org>
prev parent reply other threads:[~2026-09-29 13:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 15:23 [PATCH] IB/mad: fix UAF and double-free in RMPP receive reassembly Dairui Zhang
2026-09-22 15:33 ` sashiko-bot
2026-09-29 13:29 ` Leon Romanovsky [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=179068854196.3965508.17242912342114946649.b4-ty@kernel.org \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
--cc=security@kernel.org \
--cc=stable@vger.kernel.org \
--cc=zhangdairui@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