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 D82D143CEC7; Tue, 16 Jun 2026 18:44:05 +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=1781635446; cv=none; b=XyyAUHrQw6RXlDUanIrDJGSjZA4SkDiWLrdrrhfUFZzmWIZqHHk/RB9mHokRjVLRZV12S780TWhhTDXyTwhG1zXPndH5qcgLjoQUP8nLWZieBrxZfsIQ4pj/A7c3hYZpOgOfksjbjf3T+42uZ3i8xywEtjb6z0V4hYQ2TwgD154= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781635446; c=relaxed/simple; bh=NNLVBZ4DcaND1o7cf85cato4hURKxvDMYaVy2XUF7AQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iAdYVis8T6PDU3h9meiZ7UutJwusZ8kCoYiIUBtBmGVagiWYYqeGSMsc5STg0kFaDcVG0sBwE1XnZHDZq5Sbc0Z2u3oS6dkJhcw836iQEE2B9BmREjoBFAE4PrbmdjZg0I3ppl0oqA6LcycF/K1FwGJ7Al3FdAw/2AhZXFhUHpw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=h3wwEDfB; 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="h3wwEDfB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7A0E1F00A3D; Tue, 16 Jun 2026 18:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781635445; bh=hWjBvFq7wBiOvawGMKP/D4vB5sGA/OYUBmuT8AOGIrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=h3wwEDfBGmWzJgrYv7jF/c4ZcyISkY4WqDbWZl7950TN8wiJVcQ/urXjsr/ia2H+T vrU8kqI5x/4YBF1D9AGi/0/sJMchnQdw1rfQeoA3JlUgcqkNFSDHuTJQt7cX+abKu3 CwdBb3y45nL+jq9q00njAfUlFCFUs4hj/xKGxysc= 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 5.10 017/342] net/smc: Do not re-initialize smc hashtables Date: Tue, 16 Jun 2026 20:25:13 +0530 Message-ID: <20260616145049.081611478@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145048.348037099@linuxfoundation.org> References: <20260616145048.348037099@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 5.10-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 d64cfd651c7a16..8e1e38bc0df4b0 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -71,10 +71,12 @@ static void smc_set_keepalive(struct sock *sk, int val) 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) @@ -2586,8 +2588,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