Linux Netfilter development
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: boz baba <bababoz943@gmail.com>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org
Subject: Re: [BUG] netfilter: nft_set_pipapo_avx2: rp not reset on goto next_match retry after expired/inactive last-field element
Date: Tue, 2 Jun 2026 01:52:06 +0200	[thread overview]
Message-ID: <ah4bJmm6z6ytowqD@strlen.de> (raw)
In-Reply-To: <CAAB7JCLAzOAZ0CA5CMSkmzwCLY2+DgHSEZe15omAW2-WBTPhbQ@mail.gmail.com>

boz baba <bababoz943@gmail.com> wrote:
> While auditing the pipapo set lookup in v6.1.133 (the bug is also present
> on current mainline as of this writing) I noticed a logic error in the

Why are you auditing ancient kernel releases?

> Affected file / function
> ------------------------
> 
>   net/netfilter/nft_set_pipapo_avx2.c :: nft_pipapo_avx2_lookup()
> 
> Relevant excerpt (line numbers from v6.1.133):
> 
>   1137 :  const u8 *rp = (const u8 *)key;
>   ...
>   1175 :  nft_pipapo_avx2_prepare();
>   1176 :
>   1177 :  next_match:
>   1178 :  nft_pipapo_for_each_field(f, i, m) {
>   1179 :      bool last = i == m->field_count - 1, first = !i;
>   ...
>   1188 :      NFT_SET_PIPAPO_AVX2_LOOKUP(8, 1);     /* consumes rp */
>   ...
>   1223 :      if (ret < 0)
>   1224 :          goto out;
>   1225 :
>   1226 :      if (last) {
>   1227 :          *ext = &f->mt[ret].e->ext;
>   1228 :          if (unlikely(nft_set_elem_expired(*ext) ||
>   1229 :                       !nft_set_elem_active(*ext, genmask))) {
>   1230 :              ret = 0;
>   1231 :              goto next_match;            /* <-- restarts loop */
>   1232 :          }
>   1233 :          goto out;
>   1234 :      }

This looks very different in mainline. AFAICS this bug was fixed?

      reply	other threads:[~2026-06-01 23:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 23:05 [BUG] netfilter: nft_set_pipapo_avx2: rp not reset on goto next_match retry after expired/inactive last-field element boz baba
2026-06-01 23:52 ` Florian Westphal [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=ah4bJmm6z6ytowqD@strlen.de \
    --to=fw@strlen.de \
    --cc=bababoz943@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox