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 027F73B4EB2; Fri, 4 Sep 2026 06:00:33 +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=1788501634; cv=none; b=utx2lgYV7VHQ2+TYA3nHasxaMVD4mUcpbWtYo1ddQW3N8BWj6TksjuzBsvfV8FsYE19a+miUrJzHFIYS9peoyOxSMbtheI6dO3TuAZ8X5LgqHVx8azq13UZK8cqDL60XUh3yzBYTaF60iQMeWCBQZcZzOq/4MCcPcLgudtjiFZ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501634; c=relaxed/simple; bh=/ykHGrOa0KrrVDKWF4RMr9kdrq1QwqXYiYl1PS158c8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LEE7sfI5L2mGDkA5oYGOjiOcoAqRbT+/dJFv8zz5MTA9Tu8sTUrPUAKjQ6L2SQK5EwTdlHhvL7ckX2KLa6a7fK195TdqQzmYwq/apqwiR72oS7ffrb7DMUm7cBkR8drhtefWQL+8pHg4N6eF0zCi9ddI0hk+EgNOAkFoZTS45Y8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cJwYj7YY; 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="cJwYj7YY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AF131F00A3D; Fri, 4 Sep 2026 06:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788501632; bh=RCMF56PMBqb6rOZI62seChIcWKBNrv7Byo/sjWIe6eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cJwYj7YYQn1lezFSP8Ikd6NMxHUqETD/2E09RKFjpfYtUa0Ee4eOq8I0juIf3Uyh/ t34VOKil6q+LMuO+PD+WJn4GXD7TGVD2yeiDQlhjiMdLDoI9o6FpA65PxAMEwbSAjc qt7qisKkoVv0R8zjteIQw9VecA7Kk1pyzYyoeKaQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mahanta Jambigi , Hidayath Khan , Simon Horman , Jakub Kicinski Subject: [PATCH 6.18 477/552] net/smc: stop killed, freed and out_of_sync sharing a byte Date: Fri, 4 Sep 2026 07:00:34 +0200 Message-ID: <20260904045801.496464504@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045747.813364717@linuxfoundation.org> References: <20260904045747.813364717@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: Hidayath Khan commit db51a8658c11a82432b64999519a269c3aabb447 upstream. The three connection state flags are single-bit bitfields, so they occupy one byte of struct smc_connection and every store to one is a read-modify-write of the other two: u8 killed : 1; u8 freed : 1; u8 out_of_sync : 1; They are not written under a common lock. smc_cdc_msg_validate() sets out_of_sync from the receive tasklet, while smc_conn_kill() sets killed from process context under lock_sock(), and the receive path does not defer to the backlog when the socket is owned -- smc_cdc_msg_recv() takes only bh_lock_sock(). Give each flag its own byte so a store no longer touches its neighbours. All readers test them as booleans and are unchanged. struct smc_connection grows by two bytes. Fixes: b286a0651e44 ("net/smc: handle incoming CDC validation message") Cc: stable@vger.kernel.org Reviewed-by: Mahanta Jambigi Signed-off-by: Hidayath Khan Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260820074642.966856-2-hidayath@linux.ibm.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/smc/smc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/smc/smc.h +++ b/net/smc/smc.h @@ -277,9 +277,9 @@ struct smc_connection { * 0 for SMC-R, 32 for SMC-D */ u64 peer_token; /* SMC-D token of peer */ - u8 killed : 1; /* abnormal termination */ - u8 freed : 1; /* normal termination */ - u8 out_of_sync : 1; /* out of sync with peer */ + u8 killed; /* abnormal termination */ + u8 freed; /* normal termination */ + u8 out_of_sync; /* out of sync with peer */ }; struct smc_sock { /* smc sock container */