diff options
author | Marco Oliverio <marco.oliverio@tanaza.com> | 2019-12-02 19:54:30 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-04 19:13:21 +0100 |
commit | 766e42d68fd0c1e60960885341a7a01efd0804fc (patch) | |
tree | 54d053437c6644ab9d118e08abdf48a6f5858b4c /net/netfilter | |
parent | 7fe470885ec54b43031d28f5f5f1ca886fd944fc (diff) | |
download | linux-stable-766e42d68fd0c1e60960885341a7a01efd0804fc.tar.gz linux-stable-766e42d68fd0c1e60960885341a7a01efd0804fc.tar.bz2 linux-stable-766e42d68fd0c1e60960885341a7a01efd0804fc.zip |
netfilter: nf_queue: enqueue skbs with NULL dst
[ Upstream commit 0b9173f4688dfa7c5d723426be1d979c24ce3d51 ]
Bridge packets that are forwarded have skb->dst == NULL and get
dropped by the check introduced by
b60a77386b1d4868f72f6353d35dabe5fbe981f2 (net: make skb_dst_force
return true when dst is refcounted).
To fix this we check skb_dst() before skb_dst_force(), so we don't
drop skb packet with dst == NULL. This holds also for skb at the
PRE_ROUTING hook so we remove the second check.
Fixes: b60a77386b1d ("net: make skb_dst_force return true when dst is refcounted")
Signed-off-by: Marco Oliverio <marco.oliverio@tanaza.com>
Signed-off-by: Rocco Folino <rocco.folino@tanaza.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_queue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index a96a8c16baf9..ee6d98355081 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c @@ -174,7 +174,7 @@ static int __nf_queue(struct sk_buff *skb, const struct nf_hook_state *state, goto err; } - if (!skb_dst_force(skb) && state->hook != NF_INET_PRE_ROUTING) { + if (skb_dst(skb) && !skb_dst_force(skb)) { status = -ENETDOWN; goto err; } |