diff options
author | Eric Dumazet <edumazet@google.com> | 2023-07-28 17:03:18 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-29 19:13:41 +0200 |
commit | 8bf43be799d4b242ea552a14db10456446be843e (patch) | |
tree | e022e5d483cebc0f7a62f89b4095e07ab58ed599 /net/ipv4/ip_output.c | |
parent | net: add missing data-race annotation for sk_ll_usec (diff) | |
download | linux-8bf43be799d4b242ea552a14db10456446be843e.tar.xz linux-8bf43be799d4b242ea552a14db10456446be843e.zip |
net: annotate data-races around sk->sk_priority
sk_getsockopt() runs locklessly. This means sk->sk_priority
can be read while other threads are changing its value.
Other reads also happen without socket lock being held.
Add missing annotations where needed.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index bcdbf448324a..54d2d3a2d850 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -184,7 +184,7 @@ int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk, ip_options_build(skb, &opt->opt, daddr, rt); } - skb->priority = sk->sk_priority; + skb->priority = READ_ONCE(sk->sk_priority); if (!skb->mark) skb->mark = READ_ONCE(sk->sk_mark); @@ -528,7 +528,7 @@ packet_routed: skb_shinfo(skb)->gso_segs ?: 1); /* TODO : should we use skb->sk here instead of sk ? */ - skb->priority = sk->sk_priority; + skb->priority = READ_ONCE(sk->sk_priority); skb->mark = READ_ONCE(sk->sk_mark); res = ip_local_out(net, sk, skb); |