All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	jeremy@azazel.net, phil@nwl.cc, fw@strlen.de
Subject: Re: [PATCH nf v3] netfilter: nft_bitwise: fix dst corruption in same register shifts
Date: Fri, 24 Apr 2026 13:18:32 +0200	[thread overview]
Message-ID: <aetRiG3x9S3PQHaw@chamomile> (raw)
In-Reply-To: <20260423155453.7499-1-fmancera@suse.de>

Hi Fernando,

On Thu, Apr 23, 2026 at 05:54:53PM +0200, Fernando Fernandez Mancera wrote:
[...]
> @@ -201,6 +206,11 @@ static int nft_bitwise_init_shift(struct nft_bitwise *priv,
>  		return -EINVAL;
>  	}
>  
> +	if (priv->sreg != priv->dreg &&
> +	    priv->dreg < priv->sreg + n &&
> +	    priv->sreg < priv->dreg + n)

Is this enough? Just to make sure we are on the same page.

NFT_REG_1
NFT_REG_2
NFT_REG_3
NFT_REG_4

have a size of 128 bytes.

Then, NFT_REG32_00, NFT_REG32_01, NFT_REG32_02 and NFT_REG32_03
basically overlap with NFT_REG_1. They split the 128 bytes of
NFT_REG_1 in 4 registers of 32 bytes.

Is this check above enough to deal with the partial overlaps?

Thanks!

> +		return -EINVAL;
> +
>  	return 0;
>  }
>  
> -- 
> 2.53.0
> 
> 

  reply	other threads:[~2026-04-24 11:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 15:54 [PATCH nf v3] netfilter: nft_bitwise: fix dst corruption in same register shifts Fernando Fernandez Mancera
2026-04-24 11:18 ` Pablo Neira Ayuso [this message]
2026-04-24 15:03   ` Fernando Fernandez Mancera
2026-04-24 17:14     ` Pablo Neira Ayuso

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=aetRiG3x9S3PQHaw@chamomile \
    --to=pablo@netfilter.org \
    --cc=coreteam@netfilter.org \
    --cc=fmancera@suse.de \
    --cc=fw@strlen.de \
    --cc=jeremy@azazel.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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.