From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD5AB3932D3; Sat, 12 Sep 2026 09:58:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789207087; cv=none; b=k/L0mBRYwUBXiMdm6us0yX9LvtTdxe3RkV4Imff475+TsxEIjcHdQzmsBZcEkLYLzN3pJ8nVTOOoEVc4usg0d8RIEB/0xN/v9DWrbD02LIykSkQ2qPmIGrELIoO1bnIusIK9QqlvjaWWhD7L1mwYhFxi6/NTZ6wIMmqHu8qr49k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789207087; c=relaxed/simple; bh=FXvKxO9oi/01yBBAiVQogR9HSXbc2TpZu0dc0IlmV4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UHGxJMahapRGEv88YJ0ADL7eVYSyYFSONnTEU4FEWTerxaXoL1TYeUrp2McN6Bh+PybdNo0xplDD5NdIv5XuZ7hX7V0+W9MGcnEU+3RsHUu5HsTcZR40nVvX1XS+6xvXXVRhNcv1dn+WaxsmGvk1/r89Z+WQUWWATZ81jm4wC8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kEmOuCwA; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kEmOuCwA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2F691F000FF; Sat, 12 Sep 2026 09:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789207086; bh=Ojt7AhI8H4RCmyH6o+jTXO612UzJ/81IzlylSsCtVDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kEmOuCwAEnPNJasH4pvrcx5PBbqPbs0TN2NUKSPqfIyWImcfO1fL2LRCyaqa3dvtp DPiQ1QjUcwQJw7Yw6Wb1V8/QtoShZW0Ao14BnGCQvLLsN9Ez5kCb+zjY/COgiYf9BO HjGQbgaDhc+t3ZXjhJRnnsTMrtD9lp+hrRRwGebw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sebastian Andrzej Siewior , Leon Romanovsky , Sasha Levin Subject: [PATCH 6.18 0340/1518] RDMA/core: Wait for RCU callbacks before unloading ib_core Date: Sat, 12 Sep 2026 08:41:49 +0200 Message-ID: <20260912065631.166672712@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Leon Romanovsky [ Upstream commit 7d75592114d1664623c8cf191a12b38052c04483 ] put_gid_ndev() is queued with call_rcu() and implemented in ib_core. Stopping the workqueues does not drain callbacks already queued, so RCU could invoke it after the module code has been unloaded. synchronize_rcu() does not wait for callbacks. Wait for them after all producers have stopped. Fixes: 943bd984b108 ("RDMA/core: Allow detaching gid attribute netdevice for RoCE") Reported-by: Sebastian Andrzej Siewior Closes: https://lore.kernel.org/linux-rdma/20260708092316.Qb39F_B0@linutronix.de/ Link: https://patch.msgid.link/20260709-unload-rcu-v1-1-fccd27211e5a@nvidia.com Acked-by: Sebastian Andrzej Siewior Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/core/device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index ac9aaef1e5e61..404fc1edbe60b 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -3169,6 +3169,7 @@ static void __exit ib_core_cleanup(void) /* Make sure that any pending umem accounting work is done. */ destroy_workqueue(ib_wq); destroy_workqueue(ib_unreg_wq); + rcu_barrier(); WARN_ON(!xa_empty(&clients)); WARN_ON(!xa_empty(&devices)); } -- 2.53.0