]> git.ipfire.org Git - thirdparty/nftables.git/commit
mnl: catch bogus expressions before crashing
authorFlorian Westphal <fw@strlen.de>
Thu, 5 Jun 2025 22:20:28 +0000 (00:20 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 13 Aug 2025 17:53:11 +0000 (19:53 +0200)
commit886d553461d17861684a9af7618a680f0ba9edd1
treed45ea20375435a4e2b87c14f08d1dd8c8c958cb4
parent57bd60689569839a3ba4ec70f846df4e2f138eac
mnl: catch bogus expressions before crashing

commit d3339f9e35ee4dddf290fcc3e9cc63dac8cb836a upstream.

We can't recover from errors here, but we can abort with a more
precise reason than 'segmentation fault', or stack corruptions
that get caught way later, or not at all.

expr->value is going to be read, we can't cope with other expression
types here.

We will copy to stack buffer of IFNAMSIZ size, abort if we would
overflow.

Check there is a NUL byte present too.
This is a preemptive patch, I've seen one crash in this area but
no reproducer yet.

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