diff options
author | Eric Dumazet <edumazet@google.com> | 2022-05-13 21:55:45 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-16 12:31:06 +0300 |
commit | 36f7cec4f3af352d7f2c646461afba4cf7fd77b0 (patch) | |
tree | a485df3860e4ef1cebb569b227f0ea7a0509f5b5 /net/dccp/ipv6.c | |
parent | e5fccaa1eb7f6116deab0f708a787e2de915869f (diff) | |
download | linux-36f7cec4f3af352d7f2c646461afba4cf7fd77b0.tar.xz |
dccp: use READ_ONCE() to read sk->sk_bound_dev_if
When reading listener sk->sk_bound_dev_if locklessly,
we must use READ_ONCE().
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv6.c')
-rw-r--r-- | net/dccp/ipv6.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 4d95b6400915..d717ef0def64 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -374,10 +374,10 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) refcount_inc(&skb->users); ireq->pktopts = skb; } - ireq->ir_iif = sk->sk_bound_dev_if; + ireq->ir_iif = READ_ONCE(sk->sk_bound_dev_if); /* So that link locals have meaning */ - if (!sk->sk_bound_dev_if && + if (!ireq->ir_iif && ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL) ireq->ir_iif = inet6_iif(skb); |