netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: latten@austin.ibm.com, netdev@vger.kernel.org,
	herbert@gondor.apana.org.au, jmorris@namei.org,
	paul.moore@hp.com, vyekkirala@TrustedCS.com
Subject: Re: [PATCH]: double SAs are created when using AH and ESP together
Date: Fri, 09 Mar 2007 19:54:15 -0500	[thread overview]
Message-ID: <1173488055.16821.50.camel@localhost.localdomain> (raw)
In-Reply-To: <20070309.162027.38709797.davem@davemloft.net>

On Fri, 2007-03-09 at 16:20 -0800, David Miller wrote:
> From: Joy Latten <latten@austin.ibm.com>
> Date: Fri, 9 Mar 2007 17:14:54 -0600
> 
> > I noticed that in xfrm_state_add we look for the larval SA in a few
> > places without checking for protocol match. So when using both 
> > AH and ESP, whichever one gets added first, deletes the larval SA. 
> > It seems AH always gets added first and ESP is always the larval 
> > SA's protocol since the xfrm->tmpl has it first. Thus causing the
> > additional km_query()
> > 
> > Adding the check eliminates the double SA creation. 
> > I know this may not seem like a complete solution and I will 
> > continue to test and be on the lookout, but isn't having the
> > check a good thing? So far I have tested SAs with just ESP, just AH
> > and with both and all seems ok. 
> > 
> > Please let me know if this patch is ok. 
> > My kernel was 2.6.20-rc3-git3.
> > 
> > Signed-off-by: Joy Latten <latten@austin.ibm.com>
> 
> Generally it looks OK, but I'm going to let this one sit for
> a while before I apply it so that other folks can review it
> too and spot any unintended consequences.
> 
> In particular, I find it strance that we didn't check the
> protocol field all this time and I wonder whether that might
> be on purpose for some reason.

At least the first hunk of this patch used to be checked back in
net/ipv4/xfrm4_state.c in __xfrm4_find_acq and looks like it just was
accidentally forgotten when there was a transition to using
__find_acq_core

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2770834c9f44afd1bfa13914c7285470775af657

Since Joy found this problem on a 2.6.18 kernel originally which was
before this diff and had the proto check I'm guessing it is actually the
second hunk which is more relevant to the problem.

-Eric


  reply	other threads:[~2007-03-10  0:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09 23:14 [PATCH]: double SAs are created when using AH and ESP together Joy Latten
2007-03-10  0:20 ` David Miller
2007-03-10  0:54   ` Eric Paris [this message]
2007-03-10  1:52     ` Joy Latten
2007-03-10  0:55   ` Joy Latten
2007-03-13  0:14 ` David Miller

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=1173488055.16821.50.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jmorris@namei.org \
    --cc=latten@austin.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.moore@hp.com \
    --cc=vyekkirala@TrustedCS.com \
    /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).