diff options
author | Florian Westphal <fw@strlen.de> | 2022-06-20 17:17:30 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-06-21 11:50:40 +0300 |
commit | 574a5b85dc3b9ab672ff3fba0ee020f927960648 (patch) | |
tree | 97357fd42503d008036961aa4a5b11bfed832920 /net/bpf | |
parent | 5d79d8af8dec58bf709b3124d09d9572edd9c617 (diff) | |
download | linux-574a5b85dc3b9ab672ff3fba0ee020f927960648.tar.xz |
netfilter: nf_dup_netdev: do not push mac header a second time
Eric reports skb_under_panic when using dup/fwd via bond+egress hook.
Before pushing mac header, we should make sure that we're called from
ingress to put back what was pulled earlier.
In egress case, the MAC header is already there; we should leave skb
alone.
While at it be more careful here: skb might have been altered and
headroom reduced, so add a skb_cow() before so that headroom is
increased if necessary.
nf_do_netdev_egress() assumes skb ownership (it normally ends with
a call to dev_queue_xmit), so we must free the packet on error.
Fixes: f87b9464d152 ("netfilter: nft_fwd_netdev: Support egress hook")
Reported-by: Eric Garver <eric@garver.life>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bpf')
0 files changed, 0 insertions, 0 deletions