From: sashiko-bot@kernel.org
To: "Ziheng Wei" <zihengw03@163.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/hfi1: free CPU to SDMA map nodes after an RCU grace period
Date: Mon, 16 Nov 2026 13:26:11 +0000 [thread overview]
Message-ID: <sashiko-outbox-217071@kernel.org> (raw)
In-Reply-To: <20261116130940.1629295-1-zihengw03@163.com>
> sdma_select_user_engine() looks up the per-CPU sdma_rht_node in
> dd->sdma_rht under rcu_read_lock() and reads rht_node->map[vl],
> map->mask and map->sde[]. sdma_set_cpu_to_sde_map(), called when the
> cpu_list sysfs attribute of an SDMA engine is written, removes a node
> whose maps have become empty with rhashtable_remove_fast() and then
> kfree()s the maps and the node right away. There is no RCU grace
> period between the removal and the free, so a user SDMA submission on
> that CPU can read the node and the map after they have been freed. If
> the memory has been reused, the map pointer and the engine pointer read
> from it are arbitrary, and the caller goes on to use that engine.
>
> Writing cpu_list requires CAP_SYS_ADMIN. The reader is reachable by any
> user that can open /dev/hfi1_N, when the task submitting user SDMA
> requests is pinned to a single CPU. So this needs an administrator to
> change the SDMA engine CPU lists while jobs are running.
> [ ... ]
>
> Fixes: 0cb2aa690c7e ("IB/hfi1: Add sysfs interface for affinity setup")
> Fixes: af3674d62d34 ("IB/hfi1: Add new debugfs sdma_cpu_list file")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ziheng Wei <zihengw03@163.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116130940.1629295-1-zihengw03@163.com?part=1
prev parent reply other threads:[~2026-11-16 13:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 13:09 [PATCH] RDMA/hfi1: free CPU to SDMA map nodes after an RCU grace period Ziheng Wei
2026-11-16 13:26 ` sashiko-bot [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=sashiko-outbox-217071@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zihengw03@163.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