Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Allison Henderson <achender@kernel.org>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	pabeni@redhat.com, edumazet@google.com, kuba@kernel.org
Subject: Re: [PATCH net-next v4 1/2] net/rds: restrict the rdma_cm ids to IB devices
Date: Thu, 1 Oct 2026 13:32:22 +0100	[thread overview]
Message-ID: <20261001123222.GB13925@horms.kernel.org> (raw)
In-Reply-To: <20260927063058.170273-2-achender@kernel.org>

On Sat, Sep 26, 2026 at 11:30:57PM -0700, Allison Henderson wrote:
> RDS only has an IB transport, but it never tells the rdma_cm so.  The
> listener created in rds_rdma_listen_init() is therefore installed on
> every RDMA device in the system, including iWARP RNICs, and the id an
> outgoing connection resolves through in rds_ib_conn_path_connect()
> may be bound to whichever device the address resolution picks:
> rds_ib_laddr_check() only vouched for the local address being served
> by one of RDS's IB devices, while cma_acquire_dev_by_src_ip() walks
> every RDMA device for the same address, so a software iWARP device
> attached to the same netdev can win.  The event handler then runs
> the IB transport's callbacks against a device that is not one.
> 
> The rdma_cm has an API for exactly this since commit a760e80e90f5
> ("RDMA/core: introduce rdma_restrict_node_type()").  Restrict all
> three ids RDS creates - the listener, the per-connection id and the
> probe id in rds_ib_laddr_check_cm() - to RDMA_NODE_IB_CA before they
> are bound, so that the listener is only installed on IB devices, an
> outgoing connection can only bind one, and the address check's bind
> fails outright on anything else - which makes its explicit node_type
> test dead, so it goes; the check that the bind produced a device at
> all stays.
> 
> With that, no rdma_cm event reaches RDS's handler from a device it
> has no transport for.  The handler itself still assumes IB: it assigns
> its transport pointer only for RDMA_NODE_IB_CA and dereferences it
> regardless, which is the crash that first surfaced this.  The fix for
> that is a separate net patch, Aohan Mei's "net: rds: fix uninitialized
> trans dereference in CM event handler", and is what stable kernels
> without rdma_restrict_node_type() - which arrived in commit
> a760e80e90f5 ("RDMA/core: introduce rdma_restrict_node_type()") - have
> to take: this patch depends on that API, so stable trees need that
> separate, minimal fix rather than a backport of this one.  The two
> patches are independent and apply in either order.  The
> listener has been on every RDMA device since the iWARP transport was
> removed and left the ids unrestricted, hence the Fixes tag.
> 
> Fixes: dcdede0406d3 ("RDS: Drop stale iWARP RDMA transport")
> Assisted-by: Claude-Code:claude-fable-5
> Signed-off-by: Allison Henderson <achender@kernel.org>

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2026-10-01 12:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27  6:30 [PATCH net-next v4 0/2] net/rds: restrict the rdma_cm ids to IB devices Allison Henderson
2026-09-27  6:30 ` [PATCH net-next v4 1/2] " Allison Henderson
2026-10-01 12:32   ` Simon Horman [this message]
2026-09-27  6:30 ` [PATCH net-next v4 2/2] net/rds: log the port a listener actually bound Allison Henderson
2026-10-01 12:32   ` Simon Horman
2026-10-02  0:20 ` [PATCH net-next v4 0/2] net/rds: restrict the rdma_cm ids to IB devices patchwork-bot+netdevbpf

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=20261001123222.GB13925@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=achender@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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