]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_queue: only allow supported familes and hooks
authorFlorian Westphal <fw@strlen.de>
Tue, 26 Jul 2022 17:49:00 +0000 (19:49 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 26 Jul 2022 19:12:42 +0000 (21:12 +0200)
commitad3281a6b9978ad7b303ea53d5a6064083bd86b3
tree7b5cf8909cb4ea535ab69853e72ce215947faed0
parent7d7d7f363051e91939d1af8204fd217c0bb26e4d
netfilter: nft_queue: only allow supported familes and hooks

Trying to use 'queue' statement in ingress (for example)
triggers a splat on reinject:

WARNING: CPU: 3 PID: 1345 at net/netfilter/nf_queue.c:291

... because nf_reinject cannot find the ruleset head.

The netdev family doesn't support async resume at the moment anyway,
so disallow loading such rulesets with a more appropriate
error message.

v2: add 'validate' callback and also check hook points, v1 did
allow ingress use in 'table inet', but that doesn't work either. (Pablo)

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_queue.c