Skip to content

Commit bd9f2d0

Browse files
q2venPaolo Abeni
authored andcommitted
af_unix: Annotate data-race of net->unx.sysctl_max_dgram_qlen.
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: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent b0632e5 commit bd9f2d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/unix/af_unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern,
976976
sk->sk_hash = unix_unbound_hash(sk);
977977
sk->sk_allocation = GFP_KERNEL_ACCOUNT;
978978
sk->sk_write_space = unix_write_space;
979-
sk->sk_max_ack_backlog = net->unx.sysctl_max_dgram_qlen;
979+
sk->sk_max_ack_backlog = READ_ONCE(net->unx.sysctl_max_dgram_qlen);
980980
sk->sk_destruct = unix_sock_destructor;
981981
u = unix_sk(sk);
982982
u->listener = NULL;

0 commit comments

Comments
 (0)