aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-memset.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2024-07-15 13:54:03 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-07-17 19:00:47 +0200
commit791a615b7ad2258c560f91852be54b0480837c93 (patch)
tree71e0f470feef028124a2acb83b0daca479a46d50 /lib/test_fortify/write_overflow-memset.c
parent782161895eb4ac45cf7cfa8db375bd4766cb8299 (diff)
netfilter: nf_set_pipapo: fix initial map fill
The initial buffer has to be inited to all-ones, but it must restrict it to the size of the first field, not the total field size. After each round in the map search step, the result and the fill map are swapped, so if we have a set where f->bsize of the first element is smaller than m->bsize_max, those one-bits are leaked into future rounds result map. This makes pipapo find an incorrect matching results for sets where first field size is not the largest. Followup patch adds a test case to nft_concat_range.sh selftest script. Thanks to Stefano Brivio for pointing out that we need to zero out the remainder explicitly, only correcting memset() argument isn't enough. Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Reported-by: Yi Chen <yiche@redhat.com> Cc: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de> Reviewed-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'lib/test_fortify/write_overflow-memset.c')
0 files changed, 0 insertions, 0 deletions