aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2023-07-28 15:03:16 +0000
committerDavid S. Miller <[email protected]>2023-07-29 17:13:41 +0000
commit11695c6e966b0ec7ed1d16777d294cef865a5c91 (patch)
treeb02401c8e049b0cd7d780be6505a27ea1e5e9707 /net/unix/af_unix.c
parentnet: annotate data-races around sk->sk_mark (diff)
downloadkernel-11695c6e966b0ec7ed1d16777d294cef865a5c91.tar.gz
kernel-11695c6e966b0ec7ed1d16777d294cef865a5c91.zip
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 <[email protected]> Cc: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
-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;