mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-27 13:05:03 +08:00
af_unix: Annotate data-race of sk->sk_state in unix_stream_read_skb().
[ Upstream commitaf4c733b6b
] 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:77462de14a
("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>
This commit is contained in:
parent
cb1b9bee4b
commit
836a0b5763
@ -2600,7 +2600,7 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,
|
||||
static int unix_stream_read_sock(struct sock *sk, read_descriptor_t *desc,
|
||||
sk_read_actor_t recv_actor)
|
||||
{
|
||||
if (unlikely(sk->sk_state != TCP_ESTABLISHED))
|
||||
if (unlikely(READ_ONCE(sk->sk_state) != TCP_ESTABLISHED))
|
||||
return -ENOTCONN;
|
||||
|
||||
return unix_read_sock(sk, desc, recv_actor);
|
||||
|
Loading…
Reference in New Issue
Block a user