From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6073E350A05; Thu, 15 Jan 2026 17:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768496961; cv=none; b=DLj6rno9MfZgZhbCictVILv8F2ZdCYh9X6MDaWhnWg+pNSeJJgjCoD7wwH9lXV7BIxEVmo0fjRgpRe7loz99FuNkOJCPC2fXlizTXMVvMyZ3Lol+bVoWqTXWyUaZdcMjCIN4EUaI3dwpVF1gISW9Qc0nfArA07Zc+sZV4j1r5pw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768496961; c=relaxed/simple; bh=gjHyUsVZybrrcsZ4RiVN9v10taLzWg3Dhm8WOvJoMec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N1nLhnX4O9kFdvaJPVbpj6yUf3vNAaRNK/BII3G0GRq6QJy4vv7fhNGLkYdpg62UuFN6R2Ms4JmpOY71NvfBAWeFAvW/D1cXaEoiBx5ujVRlmtK0S5Nd1K61oWk02WbedIfoFfeHYm6Wb6cYUZSwEVzQ7GKzpGsTXGrQ9B2wAEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=y3VCieXZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="y3VCieXZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D00CC116D0; Thu, 15 Jan 2026 17:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768496961; bh=gjHyUsVZybrrcsZ4RiVN9v10taLzWg3Dhm8WOvJoMec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y3VCieXZBbgvE2eNgb8AUprLwlGFQfRyTyIZhO2C1MUS3t0JS4yVu8FUQs9QWQHPt pZ14/FpTB4X87PTlPHJKH0/JXKQDDC2pBkxAIlnmivktlRzd4Mogbe4bLG5hSUBgVn N2rE8j0BR+J30ZpLXJn2K2Mz+UOijLKhvdEe0bY0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Fernando Fernandez Mancera , Florian Westphal , Sasha Levin Subject: [PATCH 6.6 43/88] netfilter: nft_synproxy: avoid possible data-race on update operation Date: Thu, 15 Jan 2026 17:48:26 +0100 Message-ID: <20260115164147.868997181@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164146.312481509@linuxfoundation.org> References: <20260115164146.312481509@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org 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: Fernando Fernandez Mancera [ Upstream commit 36a3200575642846a96436d503d46544533bb943 ] During nft_synproxy eval we are reading nf_synproxy_info struct which can be modified on update operation concurrently. As nf_synproxy_info struct fits in 32 bits, use READ_ONCE/WRITE_ONCE annotations. Fixes: ee394f96ad75 ("netfilter: nft_synproxy: add synproxy stateful object support") Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Florian Westphal Signed-off-by: Sasha Levin --- net/netfilter/nft_synproxy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/netfilter/nft_synproxy.c b/net/netfilter/nft_synproxy.c index 5d3e518259859..4d3e5a31b4125 100644 --- a/net/netfilter/nft_synproxy.c +++ b/net/netfilter/nft_synproxy.c @@ -48,7 +48,7 @@ static void nft_synproxy_eval_v4(const struct nft_synproxy *priv, struct tcphdr *_tcph, struct synproxy_options *opts) { - struct nf_synproxy_info info = priv->info; + struct nf_synproxy_info info = READ_ONCE(priv->info); struct net *net = nft_net(pkt); struct synproxy_net *snet = synproxy_pernet(net); struct sk_buff *skb = pkt->skb; @@ -79,7 +79,7 @@ static void nft_synproxy_eval_v6(const struct nft_synproxy *priv, struct tcphdr *_tcph, struct synproxy_options *opts) { - struct nf_synproxy_info info = priv->info; + struct nf_synproxy_info info = READ_ONCE(priv->info); struct net *net = nft_net(pkt); struct synproxy_net *snet = synproxy_pernet(net); struct sk_buff *skb = pkt->skb; @@ -340,7 +340,7 @@ static void nft_synproxy_obj_update(struct nft_object *obj, struct nft_synproxy *newpriv = nft_obj_data(newobj); struct nft_synproxy *priv = nft_obj_data(obj); - priv->info = newpriv->info; + WRITE_ONCE(priv->info, newpriv->info); } static struct nft_object_type nft_synproxy_obj_type; -- 2.51.0