linux/net/rds
Aohan Mei f97d8c7bab rds: ib: use rds_conn_drop() on protocol version mismatch
rds_ib_cm_connect_complete() runs from the RDMA-CM event handler with
conn->c_cm_lock held.  When the peer negotiates a protocol version
older than RDS_PROTOCOL_COMPAT_VERSION, the handler calls
rds_conn_destroy(), which is only safe in the rmmod path: it
synchronously tears the connection down and flush_work()es the
shutdown work cp_down_w.

That shutdown work (rds_conn_shutdown()) needs cp_cm_lock, which is
the very lock the event handler still holds, so the flush never
completes: the two workers wait on each other and the RDS connection
workqueues stall for good.

All other RDMA-CM failure paths (REJECTED, CONNECT_ERROR,
DISCONNECTED) use rds_conn_drop(), which marks the connection
RDS_CONN_ERROR and schedules the shutdown work asynchronously.  Use
it here as well.

Fixes: f147dd9eca ("RDS/IB: Disallow connections less than RDS 3.1")
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Cc: stable@vger.kernel.org
Reviewed-by: Allison Henderson <achender@kernel.org>
Signed-off-by: Aohan Mei <henrymei@tencent.com>
Link: https://patch.msgid.link/20260911073436.3542080-1-ljp1205831794@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-14 18:47:52 -07: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: don't let rds_conn_shutdown() consume a concurrent drop 2026-09-02 19:42:24 -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: Increment i_fastreg_wrs before bailing out 2025-09-15 16:47:53 -07: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 rds: Fix spelling mistakes 2021-05-31 22:45:05 -07:00
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 net/rds: Fix 'ib_evt_handler_call' element in 'rds_ib_stat_names' 2019-09-15 20:56:19 +02:00
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 rds: clean up loopback rds_connections on netns deletion 2018-06-27 10:11:03 +09:00
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: Fix possible NULL-pointer dereference 2023-09-20 08:49:03 +01:00
rdma_transport.h net/rds: Remove unused function declarations 2023-08-13 12:25:42 +01:00
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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
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 rds: transport module should be auto loaded when transport is set 2020-06-25 16:26:25 -07:00