summaryrefslogtreecommitdiff
path: root/include/net/ipv6_frag.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-01-13 01:22:29 -0800
committerDavid S. Miller <davem@davemloft.net>2022-01-13 13:06:05 +0000
commit91341fa0003befd097e190ec2a4bf63ad957c49a (patch)
tree9a7ae534e177de1206e62ae6b9f61afdc45a40b5 /include/net/ipv6_frag.h
parent3ba8c6258eb19a6212b066a383788174dd9779ab (diff)
downloadlwn-91341fa0003befd097e190ec2a4bf63ad957c49a.tar.gz
lwn-91341fa0003befd097e190ec2a4bf63ad957c49a.zip
inet: frags: annotate races around fqdir->dead and fqdir->high_thresh
Both fields can be read/written without synchronization, add proper accessors and documentation. Fixes: d5dd88794a13 ("inet: fix various use-after-free in defrags units") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipv6_frag.h')
-rw-r--r--include/net/ipv6_frag.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/ipv6_frag.h b/include/net/ipv6_frag.h
index 851029ecff13..0a4779175a52 100644
--- a/include/net/ipv6_frag.h
+++ b/include/net/ipv6_frag.h
@@ -67,7 +67,8 @@ ip6frag_expire_frag_queue(struct net *net, struct frag_queue *fq)
struct sk_buff *head;
rcu_read_lock();
- if (fq->q.fqdir->dead)
+ /* Paired with the WRITE_ONCE() in fqdir_pre_exit(). */
+ if (READ_ONCE(fq->q.fqdir->dead))
goto out_rcu_unlock;
spin_lock(&fq->q.lock);