From: sashiko-bot@kernel.org
To: "Allison Henderson" <achender@kernel.org>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next v2 5/9] net/rds: unlink transport nodes before a possibly deferred connection free
Date: Sun, 13 Sep 2026 03:50:39 +0000 [thread overview]
Message-ID: <20260913035039.766A01F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260912035027.27447-6-achender@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] rds_ib_destroy_nodev_conns() uses list_splice() without reinitializing the source list, causing a use-after-free write on subsequent resweep invocations.
--
commit cee612cc1485655f9584ac5a60a9a25e2010e66b
Author: Allison Henderson <achender@kernel.org>
net/rds: unlink transport nodes before a possibly deferred connection free
This patch updates RDS transport teardown helpers to unlink nodes from their
stack-based temporary lists before destroying the connection. This prevents
a memory corruption where a deferred connection free attempts to unlink a
node from a stack frame that has already disappeared.
> diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
> index db7e92e7bd29f..b30f2a3715878 100644
> --- a/net/rds/ib_rdma.c
> +++ b/net/rds/ib_rdma.c
> @@ -168,8 +168,18 @@ void rds_ib_destroy_nodev_conns(void)
> list_splice(&ib_nodev_conns, &tmp_list);
[Severity: High]
This isn't a bug introduced by this patch, but it existed before and is not
addressed in this series. Does this list_splice() leave the original list head
dangling?
If rds_ib_destroy_nodev_conns() is called multiple times, such as when used
as a resweep callback from rds_conn_wait_conns_freed() during module unload,
subsequent invocations might see a non-empty ib_nodev_conns list because
list_splice() does not re-initialize the source list.
Could splicing this list again result in a use-after-free write to the prev
and next pointers of nodes that were already moved to a temporary stack list
and potentially freed? I notice rds_loop_exit() explicitly calls
INIT_LIST_HEAD() after splicing. Would using list_splice_init() be safer here?
> spin_unlock_irq(&ib_nodev_conns_lock);
>
> - list_for_each_entry_safe(ic, _ic, &tmp_list, ib_node)
> + /* rds_conn_destroy() can return before the connection is freed,
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260912035027.27447-1-achender@kernel.org?part=5
next prev parent reply other threads:[~2026-09-13 3:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 3:50 [PATCH net-next v2 0/9] net/rds: make connection lifetime reference-counted Allison Henderson
2026-09-12 3:50 ` [PATCH net-next v2 1/9] net/rds: guard every work-requeueing site with rds_destroy_pending() Allison Henderson
2026-09-13 3:50 ` sashiko-bot
2026-09-12 3:50 ` [PATCH net-next v2 2/9] net/rds: make rds_destroy_pending() cover single-connection destroy Allison Henderson
2026-09-13 3:50 ` sashiko-bot
2026-09-12 3:50 ` [PATCH net-next v2 3/9] net/rds: split connection destroy into quiesce and kref-governed free Allison Henderson
2026-09-13 3:50 ` sashiko-bot
2026-09-12 3:50 ` [PATCH net-next v2 4/9] net/rds: wait for connections to be freed on transport unload Allison Henderson
2026-09-13 3:50 ` sashiko-bot
2026-09-12 3:50 ` [PATCH net-next v2 5/9] net/rds: unlink transport nodes before a possibly deferred connection free Allison Henderson
2026-09-13 3:50 ` sashiko-bot [this message]
2026-09-12 3:50 ` [PATCH net-next v2 6/9] net/rds: hold connection references in lookup, sockets and c_passive Allison Henderson
2026-09-13 3:50 ` sashiko-bot
2026-09-12 3:50 ` [PATCH net-next v2 7/9] net/rds: pin the connection across RDMA-CM event handling Allison Henderson
2026-09-13 3:50 ` sashiko-bot
2026-09-12 3:50 ` [PATCH net-next v2 8/9] net/rds: drop rds_conn_count in favor of t_conn_count Allison Henderson
2026-09-13 3:50 ` sashiko-bot
2026-09-12 3:50 ` [PATCH net-next v2 9/9] net/rds: hold a connection reference from struct rds_incoming Allison Henderson
2026-09-13 3:50 ` sashiko-bot
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=20260913035039.766A01F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=achender@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.