From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03A6F1F00A07; Sat, 5 Dec 2026 03:05:35 +0000 (UTC) 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== Subject: Re: [PATCH net v7 1/3] net/rds: register the IB transport last From: netdev-bot+sashiko@kernel.org To: chenaibing@cmss.chinamobile.com Cc: achender@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org Date: Sat, 05 Dec 2026 03:05:35 +0000 Message-ID: <179643993556.3146.8810501964132839504@kernel.org> In-Reply-To: <20261204022245.381-2-chenaibing@cmss.chinamobile.com> References: <20261204022245.381-2-chenaibing@cmss.chinamobile.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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 [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