Skip to content

Commit e05a5f5

Browse files
edumazetdavem330
authored andcommitted
net: annotate sk->sk_err write from do_recvmmsg()
do_recvmmsg() can write to sk->sk_err from multiple threads. As said before, many other points reading or writing sk_err need annotations. Fixes: 34b88a6 ("net: Fix use after free in the recvmmsg exit path") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: syzbot <syzkaller@googlegroups.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a939d14 commit e05a5f5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2911,7 +2911,7 @@ static int do_recvmmsg(int fd, struct mmsghdr __user *mmsg,
29112911
* error to return on the next call or if the
29122912
* app asks about it using getsockopt(SO_ERROR).
29132913
*/
2914-
sock->sk->sk_err = -err;
2914+
WRITE_ONCE(sock->sk->sk_err, -err);
29152915
}
29162916
out_put:
29172917
fput_light(sock->file, fput_needed);

0 commit comments

Comments
 (0)