netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Jan Engelhardt <jengelh@inai.de>
Cc: Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH -next 3/4] netfilter: xtables: don't save/restore jumpstack offset
Date: Thu, 9 Jul 2015 02:29:55 +0200	[thread overview]
Message-ID: <20150709002955.GJ16864@breakpoint.cc> (raw)
In-Reply-To: <alpine.LSU.2.20.1507082344210.16936@nerf40.vanv.qr>

Jan Engelhardt <jengelh@inai.de> wrote:
> On Wednesday 2015-07-08 23:15, Florian Westphal wrote:
> 
> >The jump stack overflow tests are no longer needed as well -- since 
> >->stacksize is the largest call depth we cannot exceed it.
> 
> The tests were once added for the rare case that a cloned packet hits 
> another TEE. Can we be sure they are no longer needed?

Hmm, not sure I understand.

If a TEE'd skb hits another TEE target there is no reentry since the
tee_active percpu indicator is true.

So where can we enter ip(6)tables *twice* via TEE?
Sure, a TEE'd packet can e.g. hit REJECT which then causes another
reentry into ip(6)tables. But it should be ok since we 'only' clobber
the "alternate" jumpstack and a DROP will be issued by REJECT.

Could you please outline a problematic scenario?  Thanks!

> >+	/* No TEE support for arptables, so no need to switch to alternate
> >+	 * stack.  All targets that reenter must return absolte verdicts.
> 
> absolute

Thanks, will fix

> >+	/* Switch to alternate jumpstack if we're being invoked via TEE.
> >+	 * The problem is that TEE issues XT_CONTINUE verdict on original
> >+	 * skb so we must not clobber the jumpstack.
> 
> Well that is not really a problem but a feature :)

Sorry, I did not mean to imply TEE was misbehaving.  I'll shorten this
to: "TEE will issue XT_CONTINUE verdict" ...

Thanks for reviewing.

  reply	other threads:[~2015-07-09  0:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 21:15 [PATCH -next 0/4] netfilter: xtables: improve jumpstack handling Florian Westphal
2015-07-08 21:15 ` [PATCH -next 1/4] xtables: compute exact size needed for jumpstack Florian Westphal
2015-07-08 21:15 ` [PATCH -next 2/4] netfilter: move tee_active to core Florian Westphal
2015-07-08 21:15 ` [PATCH -next 3/4] netfilter: xtables: don't save/restore jumpstack offset Florian Westphal
2015-07-08 21:47   ` Jan Engelhardt
2015-07-09  0:29     ` Florian Westphal [this message]
2015-07-09  8:16       ` Jan Engelhardt
2015-07-09  7:54   ` Eric Dumazet
2015-07-09  9:14     ` Florian Westphal
2015-07-08 21:15 ` [PATCH RFC -next 4/4] netfilter: xtables: add upper limit on call chain depth Florian Westphal

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=20150709002955.GJ16864@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=eric.dumazet@gmail.com \
    --cc=jengelh@inai.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).