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: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent b0632e5 commit bd9f2d0

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
@@ -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)