summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-09-07 07:58:41 +0000
committerJakub Kicinski <kuba@kernel.org>2026-09-10 18:35:33 -0700
commitb5e8eadb1c8a800b1fe7bec42b5e0c696f69e1aa (patch)
tree6539c4ae11097a5a4fd88bb1c51c8a6e2f938528
parent88b84cae6b94087d3a9679845fe28ad19c7bef8b (diff)
downloadlinux-next-b5e8eadb1c8a800b1fe7bec42b5e0c696f69e1aa.tar.gz
linux-next-b5e8eadb1c8a800b1fe7bec42b5e0c696f69e1aa.zip
sit: annotate data-races around tunnel->fwmark
ipip6_tunnel_xmit() runs locklessly (dev->lltx == true) and reads tunnel->fwmark. In preparation for converting ipip6_fill_info() to run without RTNL, add READ_ONCE() and WRITE_ONCE() annotations around tunnel->fwmark. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-5-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--net/ipv6/sit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 9a2bbd76d379..e85fa80e80d1 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -929,7 +929,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
if (!dst && !ipip6_tunnel_dst_find(skb, &dst, false))
goto tx_error;
- flowi4_init_output(&fl4, tunnel->parms.link, tunnel->fwmark,
+ flowi4_init_output(&fl4, tunnel->parms.link, READ_ONCE(tunnel->fwmark),
tos & INET_DSCP_MASK, RT_SCOPE_UNIVERSE,
IPPROTO_IPV6, 0, dst, tiph->saddr, 0, 0,
sock_net_uid(tunnel->net, NULL));
@@ -1153,7 +1153,7 @@ static void ipip6_tunnel_update(struct ip_tunnel *t,
t->parms.iph.frag_off = p->iph.frag_off;
if (t->parms.link != p->link || t->fwmark != fwmark) {
t->parms.link = p->link;
- t->fwmark = fwmark;
+ WRITE_ONCE(t->fwmark, fwmark);
ipip6_tunnel_bind_dev(t->dev);
}
dst_cache_reset(&t->dst_cache);
@@ -1706,7 +1706,7 @@ static int ipip6_fill_info(struct sk_buff *skb, const struct net_device *dev)
nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->iph.protocol) ||
nla_put_be16(skb, IFLA_IPTUN_FLAGS,
ip_tunnel_flags_to_be16(parm->i_flags)) ||
- nla_put_u32(skb, IFLA_IPTUN_FWMARK, tunnel->fwmark))
+ nla_put_u32(skb, IFLA_IPTUN_FWMARK, READ_ONCE(tunnel->fwmark)))
goto nla_put_failure;
#ifdef CONFIG_IPV6_SIT_6RD