netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Cc: Florian Westphal <fw@strlen.de>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH 1/1] payload: only merge if adjacent and combined size fits into a register
Date: Mon, 18 Apr 2016 20:20:00 +0200	[thread overview]
Message-ID: <20160418182000.GA2580@salvia> (raw)
In-Reply-To: <CAOkSjBhw32VvJewnQitmVxKzrBSG3yp=38g5cCzgsDvhmiVRZA@mail.gmail.com>

On Sat, Apr 16, 2016 at 03:17:56PM +0200, Arturo Borrero Gonzalez wrote:
> On 15 April 2016 at 15:09, Florian Westphal <fw@strlen.de> wrote:
> > add rule ip6 filter input ip6 saddr ::1/128 ip6 daddr ::1/128 fails,
> > we ask to compare a 32byte immediate which is not supported:
> >
> >   [ payload load 32b @ network header + 8 => reg 1 ]
> >   [ cmp eq reg 1 0x00000000 0x00000000 0x00000000 0x01000000 0x00000000 0x00000000 0x00000000 0x02000000 ]
> >
> > We would need to use two cmps in this case, i.e.:
> >
> >   [ payload load 32b @ network header + 8 => reg 1 ]
> >   [ cmp eq reg 1 0x00000000 0x00000000 0x00000000 0x01000000 ]
> >   [ cmp eq reg 2 0x00000000 0x00000000 0x00000000 0x02000000 ]
> >
> > Seems however that this requires a bit more changes to how nft
> > handles register allocations, we'd also need to undo the constant merge.
> >
> > Lets disable merging for now so that we generate
> >
> >   [ payload load 16b @ network header + 8 => reg 1 ]
> >   [ cmp eq reg 1 0x00000000 0x00000000 0x00000000 0x01000000 ]
> >   [ payload load 16b @ network header + 24 => reg 1 ]
> >   [ cmp eq reg 1 0x00000000 0x00000000 0x00000000 0x02000000 ]
> >
> > ... if merge would bring us over the 128 bit register size.
> >
> > Closes: http://bugzilla.netfilter.org/show_bug.cgi?id=1032
> > Signed-off-by: Florian Westphal <fw@strlen.de>
> > ---
> >  include/payload.h               |  2 +-
> >  src/payload.c                   | 27 ++++++++++++++++++++-------
> >  src/rule.c                      |  2 +-
> >  tests/py/ip6/ip6.t              |  1 +
> >  tests/py/ip6/ip6.t.payload.inet |  9 +++++++++
> >  tests/py/ip6/ip6.t.payload.ip6  |  7 +++++++
> >  6 files changed, 39 insertions(+), 9 deletions(-)
> >
> 
> Acked-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

      reply	other threads:[~2016-04-18 18:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 13:09 [PATCH 1/1] payload: only merge if adjacent and combined size fits into a register Florian Westphal
2016-04-16 13:17 ` Arturo Borrero Gonzalez
2016-04-18 18:20   ` 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=20160418182000.GA2580@salvia \
    --to=pablo@netfilter.org \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=fw@strlen.de \
    --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).