All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Florian Westphal <fw@strlen.de>
Cc: <netfilter-devel@vger.kernel.org>, Yi Chen <yiche@redhat.com>
Subject: Re: [PATCH nf] netfilter: nf_set_pipapo: fix initial map fill
Date: Mon, 15 Jul 2024 16:30:41 +0200	[thread overview]
Message-ID: <20240715163041.60249207@elisabeth> (raw)
In-Reply-To: <20240715115407.2542-1-fw@strlen.de>

On Mon, 15 Jul 2024 13:54:03 +0200
Florian Westphal <fw@strlen.de> wrote:

> 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.

Thanks for fixing this!

> 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>

-- 
Stefano


      reply	other threads:[~2024-07-15 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 11:54 [PATCH nf] netfilter: nf_set_pipapo: fix initial map fill Florian Westphal
2024-07-15 14:30 ` Stefano Brivio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240715163041.60249207@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=yiche@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.