summaryrefslogtreecommitdiff
path: root/net/unix
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-07-28 15:03:16 +0000
committerDavid S. Miller <davem@davemloft.net>2023-07-29 18:13:41 +0100
commit11695c6e966b0ec7ed1d16777d294cef865a5c91 (patch)
treeb02401c8e049b0cd7d780be6505a27ea1e5e9707 /net/unix
parent3c5b4d69c358a9275a8de98f87caf6eda644b086 (diff)
net: add missing data-race annotations around sk->sk_peek_off
sk_getsockopt() runs locklessly, thus we need to annotate the read of sk->sk_peek_off. While we are at it, add corresponding annotations to sk_set_peek_off() and unix_set_peek_off(). Fixes: b9bb53f3836f ("sock: convert sk_peek_offset functions to WRITE_ONCE") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 78585217f61a..86930a8ed012 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -790,7 +790,7 @@ static int unix_set_peek_off(struct sock *sk, int val)
if (mutex_lock_interruptible(&u->iolock))
return -EINTR;
- sk->sk_peek_off = val;
+ WRITE_ONCE(sk->sk_peek_off, val);
mutex_unlock(&u->iolock);
return 0;