aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netfilter_netdev.h
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2022-01-07 15:46:16 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2022-01-09 23:35:16 +0100
commit6316136ec6e3dd1c302f7e7289a9ee46ecc610ae (patch)
tree2f445be8e7bf12d80ee45d111729c9f58efe1b5a /include/linux/netfilter_netdev.h
parentnet: prefer nf_ct_put instead of nf_conntrack_put (diff)
downloadlinux-dev-6316136ec6e3dd1c302f7e7289a9ee46ecc610ae.tar.xz
linux-dev-6316136ec6e3dd1c302f7e7289a9ee46ecc610ae.zip
netfilter: egress: avoid a lockdep splat
include/linux/netfilter_netdev.h:97 suspicious rcu_dereference_check() usage! 2 locks held by sd-resolve/1100: 0: ..(rcu_read_lock_bh){1:3}, at: ip_finish_output2 1: ..(rcu_read_lock_bh){1:3}, at: __dev_queue_xmit __dev_queue_xmit+0 .. The helper has two callers, one uses rcu_read_lock, the other rcu_read_lock_bh(). Annotate the dereference to reflect this. Fixes: 42df6e1d221dd ("netfilter: Introduce egress hook") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to '')
-rw-r--r--include/linux/netfilter_netdev.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/netfilter_netdev.h b/include/linux/netfilter_netdev.h
index b71b57a83bb4..b4dd96e4dc8d 100644
--- a/include/linux/netfilter_netdev.h
+++ b/include/linux/netfilter_netdev.h
@@ -94,7 +94,7 @@ static inline struct sk_buff *nf_hook_egress(struct sk_buff *skb, int *rc,
return skb;
#endif
- e = rcu_dereference(dev->nf_hooks_egress);
+ e = rcu_dereference_check(dev->nf_hooks_egress, rcu_read_lock_bh_held());
if (!e)
return skb;