linux/net/rds
Allison Henderson 98d446b7c0 net/rds: don't let the rdma_cm destroy an id RDS still owns on route failure
rds_rdma_cm_event_handler_cmn() hands the return value of
rdma_resolve_route() straight back to the rdma_cm on
RDMA_CM_EVENT_ADDR_RESOLVED.  A synchronous failure there - -ENOMEM
from the route work allocation, an SA query that cannot be set up, a
RoCE route with no usable device - makes addr_handler() destroy the
id the event was delivered on.  That id is ic->i_cm_id, and nothing
clears the pointer: the connection sits in RDS_CONN_CONNECTING with a
freed id until its shutdown calls rdma_disconnect() and
rdma_destroy_id() on it.

The ROUTE_RESOLVED case already avoids this: rds_ib_cm_initiate_connect()
forces a zero return while ic->i_cm_id == cm_id, as the comment there
explains.  Do the same here - drop the connection and return 0 - so
the id stays RDS's to destroy from the shutdown, and the reconnect
gets a fresh one.

Fixes: 55b7ed0b58 ("RDS: Common RDMA transport code")
Assisted-by: LLM
Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20261003163408.250568-3-achender@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-10-12 18:12:03 +02:00
..
af_rds.c rds: convert to getsockopt_iter 2026-06-11 12:19:05 +02:00
bind.c net: Convert proto_ops bind() callbacks to use sockaddr_unsized 2025-11-04 19:10:32 -08: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 rds: ib: use rds_conn_drop() on protocol version mismatch 2026-09-14 18:47:52 -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 net/rds: acquire the fastpath locks in rds_conn_shutdown() 2026-09-02 19:42:23 -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: Remove the now superfluous sentinel elements from ctl_table array 2024-05-03 13:29:42 +01:00
ib.c RDMA v7.3 merge window pull 2026-08-21 11:48:54 -07:00
ib.h net/rds: Optimize rds_ib_laddr_check 2026-04-12 13:33:19 -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 net: rds: add option for GCOV profiling 2024-08-09 13:18:46 +01:00
loop.c net/rds: initialize i_conn_path in rds_inc_init() 2026-08-13 12:52:29 +02:00
loop.h
Makefile net: rds: add option for GCOV profiling 2024-08-09 13:18:46 +01:00
message.c net/rds: fix tcp stream corruption with large pages 2026-09-10 08:19:17 -07:00
page.c rds: Use nested-BH locking for rds_page_remainder 2025-05-15 15:23:31 +02:00
rdma_transport.c net/rds: don't let the rdma_cm destroy an id RDS still owns on route failure 2026-10-12 18:12:03 +02: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: hold the socket while an rds_mr references it 2026-08-04 18:00:54 -07:00
recv.c net/rds: clear i_rx_lat_trace in rds_inc_path_init() 2026-08-13 12:53:14 +02:00
send.c net/rds: acquire the fastpath locks in rds_conn_shutdown() 2026-09-02 19:42:23 -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: Remove the now superfluous sentinel elements from ctl_table array 2024-05-03 13:29:42 +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 net/rds: rds_tcp_conn_path_shutdown must not discard messages 2026-02-04 20:46:38 -08:00
tcp_stats.c
tcp.c net/rds: don't let rds_conn_shutdown() consume a concurrent drop 2026-09-02 19:42:24 -07: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