]> git.ipfire.org Git - thirdparty/nftables.git/commit
payload: return early if dependency is not a payload expression
authorFlorian Westphal <fw@strlen.de>
Tue, 25 Feb 2025 20:13:33 +0000 (21:13 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 25 Feb 2025 23:51:41 +0000 (00:51 +0100)
commit50f45c004adbab6a077609088becf62d2651101f
tree0d9450e88ad97c10ab588f04ba49841b55e43d86
parent774915f0af277f7c4d61b84e6de34e0f8ff2b301
payload: return early if dependency is not a payload expression

 if (dep->left->payload.base != PROTO_BASE_TRANSPORT_HDR)

is legal only after checking that ->left points to an
EXPR_PAYLOAD expression. The dependency store can also contain
EXPR_META, in this case we access a bogus part of the union.

The payload_may_dependency_kill_icmp helper can't handle a META
dep either, so return early.

Fixes: 533565244d88 ("payload: check icmp dependency before removing previous icmp expression")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/payload.c