summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-09-27 17:29:24 -0700
committerDavid S. Miller <davem@davemloft.net>2021-09-28 13:21:16 +0100
commita9f5970767d11eadc805d5283f202612c7ba1f59 (patch)
tree8d89295bb3d1e3de62bb0a8f025d5a4ccee63a24 /net/ipv6/udp.c
parent103bde372f084206c6972be543ecc247ebbff9f3 (diff)
downloadlinux-a9f5970767d11eadc805d5283f202612c7ba1f59.tar.gz
linux-a9f5970767d11eadc805d5283f202612c7ba1f59.tar.bz2
linux-a9f5970767d11eadc805d5283f202612c7ba1f59.zip
net: udp: annotate data race around udp_sk(sk)->corkflag
up->corkflag field can be read or written without any lock. Annotate accesses to avoid possible syzbot/KCSAN reports. 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/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index ea53847b5b7e..e505bb007e9f 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1303,7 +1303,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
int addr_len = msg->msg_namelen;
bool connected = false;
int ulen = len;
- int corkreq = up->corkflag || msg->msg_flags&MSG_MORE;
+ int corkreq = READ_ONCE(up->corkflag) || msg->msg_flags&MSG_MORE;
int err;
int is_udplite = IS_UDPLITE(sk);
int (*getfrag)(void *, char *, int, int, int, struct sk_buff *);