diff options
author | Eric Dumazet <edumazet@google.com> | 2021-04-14 12:36:44 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-14 14:34:38 -0700 |
commit | 94f633ea8ade8418634d152ad0931133338226f6 (patch) | |
tree | c019e8e3ca087c7ffb9a076508b8f25d2726893e /net/packet/internal.h | |
parent | ae1ea84b33dab45c7b6c1754231ebda5959b504c (diff) | |
download | linux-94f633ea8ade8418634d152ad0931133338226f6.tar.bz2 |
net/packet: remove data races in fanout operations
af_packet fanout uses RCU rules to ensure f->arr elements
are not dismantled before RCU grace period.
However, it lacks rcu accessors to make sure KCSAN and other tools
wont detect data races. Stupid compilers could also play games.
Fixes: dc99f600698d ("packet: Add fanout support.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: "Gong, Sishuai" <sishuai@purdue.edu>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/internal.h')
-rw-r--r-- | net/packet/internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h index 5f61e59ebbff..48af35b1aed2 100644 --- a/net/packet/internal.h +++ b/net/packet/internal.h @@ -94,7 +94,7 @@ struct packet_fanout { spinlock_t lock; refcount_t sk_ref; struct packet_type prot_hook ____cacheline_aligned_in_smp; - struct sock *arr[]; + struct sock __rcu *arr[]; }; struct packet_rollover { |