🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27225

Re: [PATCH net v7 1/3] net/rds: register the IB transport last

#27225
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 03:05
68 lines
10487 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] Commit "net/rds: register the IB transport last" fixes a use-
  after-free of module memory that users can trigger, but its commit…

--

net/rds: register the IB transport last

This patch moves rds_trans_register(&rds_ib_transport) out of
rds_ib_init(). It now runs in rds_rdma_init(), after
rds_rdma_listen_init() succeeds, and the matching rds_trans_unregister()
moves into rds_rdma_exit(). As a result, rds_trans_get_preferred() can
no longer find the transport while the module can still fail to
initialize.

> Register the transport only once the listener is up, so that it is never
> reachable from a module that can still fail to initialize, and unregister
> it in rds_rdma_exit() before the transport is torn down.
>
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>

[Severity: Medium]
Should this patch carry Fixes: and Cc: stable tags?

The window described in the commit message seems to come from commit
8d5d8a5fd7f9 ("RDS: RDMA: start rdma listening after init"). That commit
moved rds_rdma_listen_init() after rds_ib_init(). Before it, nothing in
rds_rdma_init() could fail once rds_trans_register() had run.

A bind() or setsockopt(SO_RDS_TRANSPORT) can race with a failed load.
Either call can find the transport through rds_trans_get_preferred() or
rds_trans_get(), and try_module_get() succeeds on a module in
MODULE_STATE_COMING. A later rds_trans_put() then reads trans->t_owner
from the freed rds_ib_transport.

Something like:

Fixes: 8d5d8a5fd7f9 ("RDS: RDMA: start rdma listening after init")
Cc: stable@vger.kernel.org

The next patch in the series, "net/rds: drop rds_trans_sem around
laddr_check()", is tagged for stable, and its commit message depends on
this one:

    The transport is only registered once rds_rdma_init() can no longer
    fail, so the reference cannot be taken on a module that is about to
    be freed.

Suppose stable takes that patch without this one. Then
rds_trans_unregister() no longer waits for a laddr_check() that is
already running. After a failed init, rds_ib_laddr_check() could then
run in freed module text.

Could this patch be tagged so that both are backported together?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204022245.381-1-chenaibing%40cmss.chinamobile.com
Technical Details
Message-ID: <179643993556.3146.8810501964132839504@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377807-linux-kernel-netdev=dewy.ru
References: <20261204022245.381-2-chenaibing@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377807-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v7 1/3] net/rds: register the IB transport last
Date: Sat, 05 Dec 2026 03:05:35 +0000
Organization: Usenet Network
Message-ID: <179643993556.3146.8810501964132839504@kernel.org>
References: <20261204022245.381-2-chenaibing@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2940872"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:F18RMIhw5AXTWgLPy+U0TZdUdko= sha256:P78rxDi4UHPDbSoWJ6FDHX9n+WhyVRSrISNgS15CCgo=
	sha1:Mo6QAbLZjo1dARekyY+5rD0TxG8= sha256:ugdFulHTP5nqSUhAgPfVMmwCE3eOJ5BaK+tI+ElV5WU=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 0FC52117D5A; Sat,  5 Dec 2026 06:06:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.541
X-Spam-Status: No, score=-3.541 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id hkT_zIRF12_X;
	Sat,  5 Dec 2026 06:06:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377807-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 0A077117D1F; Sat,  5 Dec 2026 06:06:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 06D8C39088; Sat,  5 Dec 2026 03:05:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796439942;
	b=KjHXVrxiG41gYto43RtjE0O/TlOunOYk+oEwHWhsE5yjGu81uCDfA5zpdKYW9EjhfKPi
	 ejwUsd/QucGfXDExhoBw55D/w5Ur4gLp9T2g6cKJoSkODhpsdIa6KrCbOn71+g2jzvlwp
	 8bwS3J9N6s9Wa49WLp8qP+u/ghB0cDdV7BxC6aD/rzB1Pm27xeaEmbZPfGQvKF/KhS6nE
	 9B9N9/kWRvQ22CuxjuVYMvWOimgXEQBR7Efb05a67x317jHDSqdxOQNqNcbs8U8NzBCYR
	 QPyF3tqUKl3f+g+j1MWjHyIhaFN+EYM5hhmQRnpuDv5cgSl9kugyhTEKvWPsy7dmWXQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796439942;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=cDIJjxl4vfXqTQ0/LWYoZKGYh4IgMu+Q+gpbtwgQVlQ=;
	b=bEpAW/VEaOWF1XnzISMtGORjRe8m5/+ckiKApwRUiZLN/lhIQsF+JyrEGGKiDxZ/heBv
	 reoXvfLCTN2PCHwbS1LKfPxm+Nu5fHwUl1noGFG2DEUK309ZIiPkz1jlf7e5BfzAhqoxO
	 Lm+68K9D5rD0n8S3Nkf9jzcNVn23u4KzfElxilPgsgKajBXLX9fjZ31KwBNEB4h5JnSWD
	 uBhOP139Sfpa2FtSud3Q21K1aSgLb78jD3405tqz1BF3SlOGIaL3SbC6WcP9EkBomT3Ou
	 LNuzN3uKAaCgMj6cPmJSBT1mCJC3Fvq9rkTFq3uxfpE8PX06QkvfP+yI3EqGgsU5vJA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q+hfv+rk;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 8276C606A685;
	Sat,  5 Dec 2026 03:05:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q+hfv+rk
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796439936;
	b=EKB3SXVqtxavuobpwBFJStYTAqTgjXZCnnXYrAr/Yv0w3EAOPA4xY6OFUFwlgXkNW8e6
	 liHbSU0w+cWKiWU05z+6T6tnEoQY1vcKFmX4BBklbsR77Z4ZV+iL22b/VAGg2ZTW61Dya
	 IRjt7WWieQqXQZo3PrES/YLIbCFxyvu8jRrs4pVm4Cm6MKfy/Pqhj+OS4L0ZtYr0dCKj2
	 cEN5CQ8pWP7JVVCP0WVe53U0MEn+gwNlkKHUylBgtqIy/N0EjRMBf/dTiEOyFMc9rEEQC
	 1bZsWLu1UECNzdlrsxK7xgEVMYwkPmJC6VPiP4LwvLkPQC40pr6hthy1fcnANkjy4kw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796439936;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=cDIJjxl4vfXqTQ0/LWYoZKGYh4IgMu+Q+gpbtwgQVlQ=;
	b=cdsXjwe4aw+qv6PYpeyn3mtEuPWTAAKPwC4bM+hFtsizyHT0JjyeOEANpbDJ6uIEIxVF
	 N0ogLzU4VvRkIsa4UWhgoUy7liuvTfQUuAdaaUiIRdLF1haKK1FLbTdS8KsJTc09v8uEf
	 uXyQOyWljSA/hPTmxEIS4PihHgKjbi1pjk+rL/SPlX+s3bvFOsgjSgP9K7xUjgTG9UTFZ
	 7jeKc0GR7ndr8dn7NDw9s1VeetC+LQJOzV5QNiDbtZlfl6XOzHrx/aK2cEsbCfPsh40ss
	 xIDzm9ECHKYSNIa60TZD0L7hFsOZDwILj2QY13FTeMXKroDBPAOCKp+XO/Opqi/iFjA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q+hfv+rk;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2F63606A33C;
	Sat,  5 Dec 2026 03:05:36 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03A6F1F00A07;
	Sat,  5 Dec 2026 03:05:35 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796439936;
	bh=cDIJjxl4vfXqTQ0/LWYoZKGYh4IgMu+Q+gpbtwgQVlQ=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Q+hfv+rkcZz28wU1+VJCzDqLmqxwKtmVEvUr3h4nMw49x+HvuVFBIYm0tnyrtIjoD
	 Rd3vb89m4N4DhBPwP+fozSNLV3i7wjMJHGEGEAAcvWZWfdQoV6yegPiGldCz2dQDcw
	 x0ncTuBMzaMIT4IMQYRFBw2O2+FKiZDOHXgJmJZRViXiMJ3PhLmbaaf/ZTweqnuzR8
	 Z7WSFh253dAzlItlU7Vt79IjkeFLW8AzPBBgS1br9Zos/RDUyTx6FqXm2cO/mMleES
	 91oem96RknuwTGM5HVdOC+1fitiJSaQeeUw3jeQByayLB4k31GAq1j0HNXM/GSdC5G
	 uV3gpP2OdIGAw==
X-Cc: achender@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
 kuba@kernel.org
X-In-Reply-To: <20261204022245.381-2-chenaibing@cmss.chinamobile.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list