From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f12.google.com (mail-pj2-f12.google.com [74.125.227.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73E43456DE6 for ; Fri, 11 Sep 2026 07:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.140 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789112090; cv=none; b=VSAq8MkvfdtwlrHeCGDANUfZBg5EtUO+018bgHhHG7kuGHOaRKWEA+7kXLIF0pS+2Ss4dvabn4ummEm0pTf+H0HzDucBqjjbIbXj+VP1KBO2bVXzv/ZdXOZLtv/q4ks8JhquQRr8T15LnYXUXKIGERh0LP5C5AzQl8TTMARvCtc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789112090; c=relaxed/simple; bh=ofD9vuZ8WriYaz45r03nVr4VI+oGJALE7F2gieVLqec=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kk2M3dslmVCdEdnxs3C0zxlSLvKUlj0SaKIzBiMIizThZ/N2D8J3v6pyJhuqCZckx6IvXccR4/tyl/4ePw78vmzas+wzWeIcMkMzkdeLRKJGA6DGsJ5SnMHSrN/KzujfyC5uGBATA3YOUPVqyDyhqEHfH9ROypcwC1IjGAiYCyo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZkQ1Y2fU; arc=none smtp.client-ip=74.125.227.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZkQ1Y2fU" Received: by mail-pj2-f12.google.com with SMTP id 98e67ed59e1d1-396ccc09d65so461280a91.3 for ; Fri, 11 Sep 2026 00:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789112088; x=1789716888; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=W6wVmYC8X8kmr5SDuvDPNWubkvtX+YkviT8aumfGWPQ=; b=ZkQ1Y2fUtTtCKjdE5Q1KGflwxOoNneCyA5lRZQdpPLxT0h1BMUgJE0pVHXCpMpK9CK JpnLF06X3+n9Io3ct4Ral5nV/3SDCPiXRL3GVKVqWXe16yP+15qH6BCybptEKGwTtVSK WcYZVZ3zfcIBUt/5ZQgkVZSgPvjLwVX0A9z2piDFkzTQZXJroRvHJE6wBrJYPhRREbrL UGCQD7Gf0hFX/AnwGaQzgtNW6GfC9HLjsO8xUk2V+LayJjsfNNV8uxAH5MnWwIODBcH/ tDxfthSUVnyzI99AYnGd3N6IXfVZkMjFOyPq0wmUxq2A1M6pUxSOl0hTpHpH/wXbhzv2 L/Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789112088; x=1789716888; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=W6wVmYC8X8kmr5SDuvDPNWubkvtX+YkviT8aumfGWPQ=; b=dYq1hPrDxjRLUC7YApaOmm4Ch1QByTrC1/Oy1kc2HGvdqzPn8Ej1GE3i4vjVK92EbR o3pDo79Me2ZN1n3OLuZIytuqXBkVNhIKkbuGj5CovEU8kOqbcRKy0HdWG9O8uSyB9MbE U9bf37N9OWgFqTZt3jjDRj/x8GXjDKEphlC6VNEzXbChwA3TefNUzxA0T8q0qKPTakJY fFkqQJrgz5uwn7mniMUP2tj2W7mHxYYrvayIgFqiQz1ZubzeMKpyeer5A7EX+HNsXwhT JjP5LB+RBPR9762k73chxr3KMMNbuQdnhmIzUi1fttNSwsMltI5BuxWZ5XG2cBpLeQwn 7rVQ== X-Forwarded-Encrypted: i=1; AKwUvBzDL08lmYkMH+OeIIeYdfXwWgDuAywMX1ufmxc8tAnV3lvscZLD+SV3XAypZZmBWw6h+Bzyk87Ix3HaM/A=@vger.kernel.org X-Gm-Message-State: AFuF++lyys71HAEdT/KL9Z5dN4Br4HRc5GaGzOPo8DdDcRdZPXG6rqLh hxE9oMIezgiClSCak8obUQ2YtQCgA2EzZVcfHxu33T+6KW66d3zepc/L X-Gm-Gg: AYBFou1BI0QV+k8rCYv3svHzEu9UlvuqYVDnmzDuvC3MuadwgCM1RjVegr6gaCSA6PL 3Eik8OktQdctZ3/R9mzm5txfDo45TIJBuuW6le+7mfx44lKNSlnEIchk56HBEt6AXm2AN7H6UwF P5WrKzl48TIyPFj7GnQOZ6N12sC/h9c+h1eDDVLGXdICtb0LyM7tovF6PBJLO/PApgh6zN9K8aC IdSFv1C3soRJpRPsbuPrZlfy2JJUXATgCgTxE4FaynXtaHYw2nKB2OBPPpxuWQ6e/nPXXJaa791 zlEwpIrffFMaJPgv9BoiFrYQHCFAbSnUIUc78mycmHfO9GHCl8qE8Ua5UgW0fG0jvvNRYRhs8cO ERdGEsUJU2O94194BKDblSdEQf2jtIDb3zpmUB/8XeNxig+vsVvcFPakqIQWj4fsy6aJPZ06wYd a9WA6yddUbtcTiXPU/MKbtg++DzfIPKMh9w8Skkzjpqul+DTaSI7Te67vLSIX2ucpDd4uhsadgp qsSSsAjoYnemtr09HoyWLdPAcJroDhTW78QhQ== X-Received: by 2002:a17:90a:ec8c:b0:396:635a:9b10 with SMTP id 98e67ed59e1d1-39d9bf0af3fmr5274805a91.11.1789112087592; Fri, 11 Sep 2026 00:34:47 -0700 (PDT) Received: from localhost.localdomain ([180.101.244.69]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39d9947b847sm3357684a91.7.2026.09.11.00.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2026 00:34:47 -0700 (PDT) From: Aohan Mei To: netdev@vger.kernel.org Cc: Allison Henderson , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org, Aohan Mei , TencentOS Corvus AI , stable@vger.kernel.org Subject: [PATCH net v2] rds: ib: use rds_conn_drop() on protocol version mismatch Date: Fri, 11 Sep 2026 15:34:32 +0800 Message-ID: <20260911073436.3542080-1-ljp1205831794@gmail.com> X-Mailer: git-send-email 2.43.7 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Aohan Mei 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: f147dd9ecabf ("RDS/IB: Disallow connections less than RDS 3.1") Reported-by: TencentOS Corvus AI Cc: stable@vger.kernel.org Assisted-by: CodeBuddy:Kimi-K3 Reviewed-by: Allison Henderson Signed-off-by: Aohan Mei --- v1 -> v2: - Point Fixes at f147dd9ecabf, which introduced the rds_conn_destroy() call in the version check, instead of the later refactor cdc306a5c9cd (Allison) - Add Allison's Reviewed-by - Link to v1: https://lore.kernel.org/netdev/20260908123356.1163970-1-henrymei@tencent.com/ net/rds/ib_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index d46146887ba4..2909da8363f3 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -115,7 +115,7 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even &conn->c_laddr, &conn->c_faddr, RDS_PROTOCOL_MAJOR(conn->c_version), RDS_PROTOCOL_MINOR(conn->c_version)); - rds_conn_destroy(conn); + rds_conn_drop(conn); return; } } -- 2.43.7