Skip to content

Commit 8c16e55

Browse files
q2venSasha Levin
authored andcommitted
af_unix: Annotate data-race of net->unx.sysctl_max_dgram_qlen.
[ Upstream commit bd9f2d0 ] net->unx.sysctl_max_dgram_qlen is exposed as a sysctl knob and can be changed concurrently. Let's use READ_ONCE() in unix_create1(). Fixes: 1da177e ("Linux-2.6.12-rc2") 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 f355ed2 commit 8c16e55

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
@@ -966,7 +966,7 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern,
966966
sk->sk_hash = unix_unbound_hash(sk);
967967
sk->sk_allocation = GFP_KERNEL_ACCOUNT;
968968
sk->sk_write_space = unix_write_space;
969-
sk->sk_max_ack_backlog = net->unx.sysctl_max_dgram_qlen;
969+
sk->sk_max_ack_backlog = READ_ONCE(net->unx.sysctl_max_dgram_qlen);
970970
sk->sk_destruct = unix_sock_destructor;
971971
u = unix_sk(sk);
972972
u->inflight = 0;

0 commit comments

Comments
 (0)