netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org, arturo.borrero.glez@gmail.com,
	linkerpro@mail.ru
Subject: Re: [PATCH nf] netfilter: nf_tables: validate hooks in NAT expressions
Date: Wed, 14 Jan 2015 18:50:27 +0100	[thread overview]
Message-ID: <20150114175027.GA21424@salvia> (raw)
In-Reply-To: <20150114174459.GH5710@acer.localdomain>

On Wed, Jan 14, 2015 at 05:45:00PM +0000, Patrick McHardy wrote:
> On 14.01, Pablo Neira Ayuso wrote:
> > On Wed, Jan 14, 2015 at 05:17:31PM +0000, Patrick McHardy wrote:
> > > On 14.01, Pablo Neira Ayuso wrote:
> > > > The user can crash the kernel if it configures the NAT chain in the
> > > > wrong hook, so validate that the expression is used from the right
> > > > hook when loading the rule.
> > > > 
> > > > This patch introduces nft_chain_validate_hooks() which is based on
> > > > existing code in the bridge version of the reject expression.
> > > 
> > > But this will still allow use in non base chains that are called
> > > from incorrect chains, right?
> > 
> > The expression .validate callback should make sure that doesn't happen
> > once you attach the non-base chain is "attached" to some base chain
> > via jump/goto.
> 
> How so? The nf_nat_validate_dependency() function simply returns 0
> for non base chains.

The validation is also called from nf_tables_check_loops(), using the
base chain at which the non-base chain has been attached to.

  reply	other threads:[~2015-01-14 17:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 17:01 [PATCH nf] netfilter: nf_tables: validate hooks in NAT expressions Pablo Neira Ayuso
2015-01-14 17:17 ` Patrick McHardy
2015-01-14 17:28   ` Pablo Neira Ayuso
2015-01-14 17:45     ` Patrick McHardy
2015-01-14 17:50       ` Pablo Neira Ayuso [this message]
2015-01-14 17:59         ` Patrick McHardy

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=20150114175027.GA21424@salvia \
    --to=pablo@netfilter.org \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=kaber@trash.net \
    --cc=linkerpro@mail.ru \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).