OSDN Git Service

netfilter: nft_tproxy: restrict to prerouting hook
authorFlorian Westphal <fw@strlen.de>
Sat, 20 Aug 2022 15:54:06 +0000 (17:54 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 23 Aug 2022 19:24:34 +0000 (21:24 +0200)
commit18bbc3213383a82b05383827f4b1b882e3f0a5a5
tree26006a63f818301339915afbd8bfe501c8602a81
parentcf97769c761abfeac8931b35fe0e1a8d5fabc9d8
netfilter: nft_tproxy: restrict to prerouting hook

TPROXY is only allowed from prerouting, but nft_tproxy doesn't check this.
This fixes a crash (null dereference) when using tproxy from e.g. output.

Fixes: 4ed8eb6570a4 ("netfilter: nf_tables: Add native tproxy support")
Reported-by: Shell Chen <xierch@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nft_tproxy.c