All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf,v2 1/2] netfilter: nf_tables: upfront validation of data via nft_data_init()
Date: Tue, 9 Aug 2022 23:40:47 +0200	[thread overview]
Message-ID: <YvLUX+NHu4WN41JN@salvia> (raw)
In-Reply-To: <20220808173007.157055-1-pablo@netfilter.org>

On Mon, Aug 08, 2022 at 07:30:06PM +0200, Pablo Neira Ayuso wrote:
> Instead of parsing the data and then validate that type and length are
> correct, pass a description of the expected data so it can be validated
> upfront before parsing it to bail out earlier.
> 
> This patch adds a new .size field to specify the maximum size of the
> data area. The .len field is optional and it is used as an input/output
> field, it provides the specific length of the expected data in the input
> path. If then .len field is not specified, then obtained length from the
> netlink attribute is stored. This is required by cmp, bitwise, range and
> immediate, which provide no netlink attribute that describes the data
> length. The immediate expression uses the destination register type to
> infer the expected data type.
> 
> Relying on opencoded validation of the expected data might lead to
> subtle bugs as described in 7e6bc1f6cabc ("netfilter: nf_tables:
> stricter validation of element data").

For the record, this series are applied

      parent reply	other threads:[~2022-08-09 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 17:30 [PATCH nf,v2 1/2] netfilter: nf_tables: upfront validation of data via nft_data_init() Pablo Neira Ayuso
2022-08-08 17:30 ` [PATCH nf 2/2] netfilter: nf_tables: disallow jump to implicit chain from set element Pablo Neira Ayuso
2022-08-09 21:40 ` Pablo Neira Ayuso [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=YvLUX+NHu4WN41JN@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.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 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.