linux/net/rds
Allison Henderson ffbbc315b8 net/rds: do not initialize transports after rds_init() failed
rds, rds_rdma and rds_tcp each have their own module_init().  When they
are built in, those run in link order, so rds_init() goes first, but
do_initcalls() does not stop when it fails.  The transports then
initialize against a core that has already been torn down: rds_wq has
been destroyed, yet rds_ib_dev_put(), rds_ib_unregister_client() and
rds_tcp_accept_work() still queue onto or flush it, and
rds_trans_register() hands the transports to a core whose socket
family may never have been registered.

This was seen with CONFIG_SYSCTL=n, where rds_sysctl_init() failed and
rds_ib_init()'s error path then flushed the freed rds_wq [1], but any
rds_init() failure after rds_threads_init() has the same effect.

Record whether rds_init() succeeded and have rds_rdma_init() and
rds_tcp_init() bail out with -ENODEV otherwise.  Modular builds are
unaffected: the transports need symbols exported by rds.ko, so they
cannot be loaded unless rds_init() succeeded.

[1] https://lore.kernel.org/oe-lkp/202610190310.9737b2e3-lkp@intel.com
Fixes: 55b7ed0b58 ("RDS: Common RDMA transport code")
Fixes: 70041088e3 ("RDS: Add TCP transport to RDS")
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20261021195837.142802-3-achender@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-10-27 11:30:25 +01:00
..
af_rds.c net/rds: do not initialize transports after rds_init() failed 2026-10-27 11:30:25 +01:00
bind.c net/rds: keep the connected peer's scope id apart from the bound one 2026-10-23 15:16:44 -07:00
cong.c net/rds: use wq_has_sleeper() in rds_cong_map_updated() 2026-08-24 12:03:25 -07:00
connection.c net/rds: size a connection's path set by the transport it ends up with 2026-09-24 10:03:23 -07:00
ib_cm.c net/rds: ib: don't enable IRQs in rds_ib_conn_free() 2026-10-20 13:57:16 -07:00
ib_frmr.c rds: ib: Clear the sg list when mapping an MR fails 2026-09-24 13:18:19 +02:00
ib_mr.h rds: ib: Remove unused extern definition 2025-09-08 18:16:49 -07:00
ib_rdma.c net/rds: unpin MR pages with unpin_user_pages_dirty_lock() 2026-08-04 18:01:02 -07:00
ib_recv.c RDS/IB: validate receive fragment completions 2026-10-15 18:56:01 -07:00
ib_ring.c
ib_send.c net/rds: fix NULL deref in rds_ib_send_cqe_handler() on masked atomic completion 2026-06-09 18:32:54 -07:00
ib_stats.c
ib_sysctl.c net/rds: do not fail init when CONFIG_SYSCTL=n 2026-10-27 11:30:20 +01:00
ib.c net/rds: restrict the rdma_cm ids to IB devices 2026-10-01 17:11:26 -07:00
ib.h net/rds: replace tasklets with workqueue 2026-09-25 18:09:46 -07:00
info.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
info.h rds: convert to getsockopt_iter 2026-06-11 12:19:05 +02:00
Kconfig
loop.c net/rds: initialize i_conn_path in rds_inc_init() 2026-08-13 12:52:29 +02:00
loop.h
Makefile
message.c net/rds: fix tcp stream corruption with large pages 2026-09-10 08:19:17 -07:00
page.c
rdma_transport.c net/rds: do not initialize transports after rds_init() failed 2026-10-27 11:30:25 +01:00
rdma_transport.h
rdma.c net/rds: hold the socket while an rds_mr references it 2026-08-04 18:00:54 -07:00
rds_single_path.h
rds.h net/rds: do not initialize transports after rds_init() failed 2026-10-27 11:30:25 +01:00
recv.c net/rds: keep the connected peer's scope id apart from the bound one 2026-10-23 15:16:44 -07:00
send.c net/rds: keep the connected peer's scope id apart from the bound one 2026-10-23 15:16:44 -07:00
stats.c net/rds: Use the first lane until RDS_EXTHDR_NPATHS arrives 2026-02-04 20:46:39 -08:00
sysctl.c net/rds: do not fail init when CONFIG_SYSCTL=n 2026-10-27 11:30:20 +01:00
tcp_connect.c net/rds: rds_tcp_conn_path_shutdown must not discard messages 2026-02-04 20:46:38 -08:00
tcp_listen.c net/rds: tcp: don't force RDS_CONN_RESETTING over a concurrent shutdown 2026-09-02 19:42:23 -07:00
tcp_recv.c net/rds: use special gfp_t format specifier 2026-05-28 21:04:53 -07:00
tcp_send.c rds: use sk_set_nospace() 2026-10-05 16:04:49 -07:00
tcp_stats.c
tcp.c net/rds: do not initialize transports after rds_init() failed 2026-10-27 11:30:25 +01:00
tcp.h net/rds: Trigger rds_send_ping() more than once 2026-02-04 20:46:39 -08:00
threads.c net/rds: Add per cp work queue 2026-01-13 12:27:03 +01:00
transport.c