aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/neighbour.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-21 09:27:13 +0000
committerDavid S. Miller <davem@davemloft.net>2023-10-01 17:14:37 +0100
commit5baa0433a15eadd729625004c37463acb982eca7 (patch)
tree01cade72ec39778862a6f7d97eadceaf1c9d5295 /include/net/neighbour.h
parentnet: fix possible store tearing in neigh_periodic_work() (diff)
downloadwireguard-linux-5baa0433a15eadd729625004c37463acb982eca7.tar.xz
wireguard-linux-5baa0433a15eadd729625004c37463acb982eca7.zip
neighbour: fix data-races around n->output
n->output field can be read locklessly, while a writer might change the pointer concurrently. Add missing annotations to prevent load-store tearing. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r--include/net/neighbour.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 6da68886fabb..07022bb0d44d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -539,7 +539,7 @@ static inline int neigh_output(struct neighbour *n, struct sk_buff *skb,
READ_ONCE(hh->hh_len))
return neigh_hh_output(hh, skb);
- return n->output(n, skb);
+ return READ_ONCE(n->output)(n, skb);
}
static inline struct neighbour *