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 43A76477E51; Tue, 16 Jun 2026 16:40:55 +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=1781628056; cv=none; b=JtzCbMokF31VZCrI2xsxcbjeD4YEZ+Rih/DJZozvVBst/CWfOeJU4Bkwrq0T1bthegRuiYMvlsByv2d6sFR2i01Sx8z/vUUXhdH5dUWyEQd/SwTjMizkwXEXNm0IQA0gqpBU2ufKa85XXeJNAcMASfHMPcRQkKDz/VR5z060T2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781628056; c=relaxed/simple; bh=RelKAkuveNOlTdWnuqoLYJXg+fkUZ+IAqwFZ+wkVMYY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hAKLVljRCjUQb42Ln2WdE9OUNJvN48B/i1cntU/gVJ6kLqinMvucmTk2tJdVf3BIY0+bkgYblxKWZ/qXWSJcs08qcX0EhlmOLuWX41YuNnVxh+q4RM1IihqV1yi6IwRrRzS2/GFfAgwHBTMIArMdDWWeMWiNafYWdVDSH8+nbRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dNJZcVwG; 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="dNJZcVwG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 540AF1F00A3A; Tue, 16 Jun 2026 16:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781628055; bh=KSiWFAn9RysS26xeRsWJwci0jmnW2NPMf5fVjVJsNCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dNJZcVwGt3im7piHJP+ANMZ0sNag+fvBDSS+wqUD6c8Or1Hg51syw3k3JddizpYGJ zVYvy1QahnzKh7Wn4FSLzH9K9z/DRtDKGFTZUr0xcwKhK+sLP7xNB0PYy/SI637gom iEGs/tIfD2zAkEv8P0uwuKKAm+afGmQSqQnCnBTE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Halil Pasic , Alexandra Winter , Mahanta Jambigi , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 023/452] net/smc: Do not re-initialize smc hashtables Date: Tue, 16 Jun 2026 20:24:10 +0530 Message-ID: <20260616145119.059460615@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145117.796205997@linuxfoundation.org> References: <20260616145117.796205997@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexandra Winter [ Upstream commit 9e4389b0038781f19f97895186ed941ff8ac1678 ] INIT_HLIST_HEAD(&smc_v*_hashinfo.ht) are called after smc_nl_init(), proto_register() and sock_register(). This can lead to smc_v*_hashinfo.ht being reset even though hash entries already exist and are being used, possibly resulting in a corrupted list. Remove unnecessary and dangerous re-initialisation of smc_v*_hashinfo.ht in smc_init(); it is implicitly initialised to zero anyhow. Add HLIST_HEAD_INIT to the definitions for clarity. Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets") Suggested-by: Halil Pasic Signed-off-by: Alexandra Winter Acked-by: Halil Pasic Reviewed-by: Mahanta Jambigi Link: https://patch.msgid.link/20260521145639.10317-1-wintera@linux.ibm.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/smc/af_smc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 6629fd61be06a6..7a82e1a8a83f4b 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -181,10 +181,12 @@ static bool smc_hs_congested(const struct sock *sk) static struct smc_hashinfo smc_v4_hashinfo = { .lock = __RW_LOCK_UNLOCKED(smc_v4_hashinfo.lock), + .ht = HLIST_HEAD_INIT, }; static struct smc_hashinfo smc_v6_hashinfo = { .lock = __RW_LOCK_UNLOCKED(smc_v6_hashinfo.lock), + .ht = HLIST_HEAD_INIT, }; int smc_hash_sk(struct sock *sk) @@ -3579,8 +3581,6 @@ static int __init smc_init(void) pr_err("%s: sock_register fails with %d\n", __func__, rc); goto out_proto6; } - INIT_HLIST_HEAD(&smc_v4_hashinfo.ht); - INIT_HLIST_HEAD(&smc_v6_hashinfo.ht); rc = smc_ib_register_client(); if (rc) { -- 2.53.0