aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet/internal.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-04-14 12:36:44 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 09:50:38 +0200
commit2b3ae007c6394446562f9ba2e5043fb209ab3fb0 (patch)
tree307bebfbfb48ead0646837e9d2a8e2b73950ac24 /net/packet/internal.h
parent3a1c395703bef879cc13b4b02530db72d2c3aeb6 (diff)
downloadkernel_replicant_linux-2b3ae007c6394446562f9ba2e5043fb209ab3fb0.tar.gz
kernel_replicant_linux-2b3ae007c6394446562f9ba2e5043fb209ab3fb0.tar.bz2
kernel_replicant_linux-2b3ae007c6394446562f9ba2e5043fb209ab3fb0.zip
net/packet: remove data races in fanout operations
[ Upstream commit 94f633ea8ade8418634d152ad0931133338226f6 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/packet/internal.h')
-rw-r--r--net/packet/internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h
index baafc3f3fa25..7af1e9179385 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 {