Skip to content

Commit 073b4d2

Browse files
q2venSasha Levin
authored andcommitted
af_unix: Annotate data-race of sk->sk_state in unix_stream_read_skb().
[ Upstream commit af4c733 ] unix_stream_read_skb() is called from sk->sk_data_ready() context where unix_state_lock() is not held. Let's use READ_ONCE() there. Fixes: 77462de ("af_unix: Add read_sock for stream socket types") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8383936 commit 073b4d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/unix/af_unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,7 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,
27162716

27172717
static int unix_stream_read_skb(struct sock *sk, skb_read_actor_t recv_actor)
27182718
{
2719-
if (unlikely(sk->sk_state != TCP_ESTABLISHED))
2719+
if (unlikely(READ_ONCE(sk->sk_state) != TCP_ESTABLISHED))
27202720
return -ENOTCONN;
27212721

27222722
return unix_read_skb(sk, recv_actor);

0 commit comments

Comments
 (0)