linux/net/rds
Yuqi Xu 2c5e5e4a59 net: rds: clear i_sends on setup unwind
commit 20cf0fb715 upstream.

The RDS IB connection teardown path is written so it can run during
partial startup and on repeated shutdown attempts. It uses NULL
pointers to distinguish resources that are still owned from resources
that have already been released.

When rds_ib_setup_qp() fails after allocating i_sends but before
allocating i_recvs, the sends_out path frees i_sends without clearing
the pointer. A later shutdown pass can still treat that stale pointer
as a live send ring allocation.

Clear i_sends after vfree() in the error unwind path so the existing
shutdown logic continues to use the correct ownership state.

Fixes: 3b12f73a5c ("rds: ib: add error handle")
Cc: stable@kernel.org
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Signed-off-by: Yuqi Xu <xuyq21@lenovo.com>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Reviewed-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/5a0f7624bb9845a7b67d26166a150b59e7f394ce.1779632468.git.xuyq21@lenovo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-06-19 13:33:38 +02:00
..
af_rds.c net/rds: Restrict use of RDS/IB to the initial network namespace 2026-06-01 17:35:29 +02:00
bind.c net/rds: Check laddr_check before calling it 2019-09-27 12:10:55 +02:00
cong.c net: rds: delete duplicated words 2020-09-18 14:12:43 -07:00
connection.c net/rds: zero per-item info buffer before handing it to visitors 2026-06-01 17:35:40 +02:00
ib.c net/rds: Restrict use of RDS/IB to the initial network namespace 2026-06-01 17:35:29 +02:00
ib.h net/rds: Optimize rds_ib_laddr_check 2026-06-01 17:35:29 +02:00
ib_cm.c net: rds: clear i_sends on setup unwind 2026-06-19 13:33:38 +02:00
ib_frmr.c rds: ib: Increment i_fastreg_wrs before bailing out 2025-10-02 13:39:07 +02:00
ib_mr.h RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
ib_rdma.c net/rds: Optimize rds_ib_laddr_check 2026-06-01 17:35:29 +02:00
ib_recv.c rds: add missing barrier to release_refill 2022-08-25 11:39:54 +02: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-19 13:33:35 +02: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: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00
info.c rds: mark snapshot pages dirty in rds_info_getsockopt() 2026-06-19 13:33:35 +02:00
info.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
loop.c rds: Changing IP address internal representation to struct in6_addr 2018-07-23 21:17:44 -07:00
loop.h rds: clean up loopback rds_connections on netns deletion 2018-06-27 10:11:03 +09:00
Makefile RDMA/rds: Remove FMR support for memory registration 2020-06-02 20:32:53 -03:00
message.c net/rds: reset op_nents when zerocopy page pin fails 2026-06-01 17:35:45 +02:00
page.c rds: remove dead code 2016-12-26 21:35:39 -05:00
rdma.c net: rds: fix MR cleanup on copy error 2026-06-01 17:35:15 +02:00
rdma_transport.c net: rds: Fix possible NULL-pointer dereference 2023-10-06 13:18:08 +02:00
rdma_transport.h net: rds: rdma_transport.h: delete duplicated word 2020-07-19 18:14:51 -07:00
rds.h rds: Fix endianness annotation for RDS_MPATH_HASH 2025-12-07 06:09:19 +09: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
recv.c net:rds: Fix possible deadlock in rds_message_put 2024-09-04 13:23:39 +02:00
send.c net/rds: rds_sendmsg should not discard payload_len 2026-03-04 07:19:50 -05:00
stats.c rds: check for excessive looping in rds_send_xmit 2019-08-15 12:04:24 -07:00
sysctl.c net: rds: fix coding style issues 2016-06-18 21:34:09 -07:00
tcp.c net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 12:34:49 +02:00
tcp.h RDS tcp loopback connection can hang 2021-05-21 14:46:59 -07:00
tcp_connect.c net: prevent address rewrite in kernel_bind() 2023-10-19 23:05:33 +02:00
tcp_listen.c net/rds: No shortcut out of RDS_CONN_ERROR 2026-03-04 07:20:09 -05:00
tcp_recv.c rds: Fix spelling mistakes 2021-05-31 22:45:05 -07:00
tcp_send.c tcp: add tcp_sock_set_cork 2020-05-28 11:11:45 -07:00
tcp_stats.c net: rds: fix const array syntax 2011-07-01 16:16:19 -07:00
threads.c rds: Fix fall-through warnings for Clang 2021-05-17 20:00:27 -05:00
transport.c rds: transport module should be auto loaded when transport is set 2020-06-25 16:26:25 -07:00