netfilter: conntrack: Fix data-races around ct mark
authorDaniel Xu <dxu@dxuuu.xyz>
Wed, 9 Nov 2022 19:39:07 +0000 (12:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:04 +0000 (17:41 +0100)
commit60387731e69f3fdf1021aa5ffe2c95ec12072c91
treefe6ea2066d22c78ff9549c37eac70ceebb7698c1
parentee3ccd1abbe1124ab81626457c8451ba6ae07a4a
netfilter: conntrack: Fix data-races around ct mark

[ Upstream commit 52d1aa8b8249ff477aaa38b6f74a8ced780d079c ]

nf_conn:mark can be read from and written to in parallel. Use
READ_ONCE()/WRITE_ONCE() for reads and writes to prevent unwanted
compiler optimizations.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/flow_dissector.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nft_ct.c
net/netfilter/xt_connmark.c
net/openvswitch/conntrack.c
net/sched/act_connmark.c
net/sched/act_ct.c
net/sched/act_ctinfo.c