]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: Set NFT_SET_CONCAT flag for sets with concatenated ranges
authorStefano Brivio <sbrivio@redhat.com>
Mon, 13 Apr 2020 19:48:03 +0000 (21:48 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 14 Apr 2020 21:15:05 +0000 (23:15 +0200)
commit09441b5e92ceea60198a35cd657904fa7a10ee54
treed9415672468d26b87d860347ed702b067cba8272
parentf1e5a0499c0773f18bc592dd0da0340120daa482
src: Set NFT_SET_CONCAT flag for sets with concatenated ranges

Pablo reports that nft, after commit 8ac2f3b2fca3 ("src: Add support
for concatenated set ranges"), crashes with older kernels (< 5.6)
without support for concatenated set ranges: those sets will be sent
to the kernel, which adds them without notion of the fact that
different concatenated fields are actually included, and nft crashes
while trying to list this kind of malformed concatenation.

Use the NFT_SET_CONCAT flag introduced by kernel commit ef516e8625dd
("netfilter: nf_tables: reintroduce the NFT_SET_CONCAT flag") when
sets including concatenated ranges are sent to the kernel, so that
older kernels (with no knowledge of this flag itself) will refuse set
creation.

Note that, in expr_evaluate_set(), we have to check for the presence
of the flag, also on empty sets that might carry it in context data,
and actually set it in the actual set flags.

Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c