public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Tobias Brunner <tobias@strongswan•org>
To: Steffen Klassert <steffen.klassert@secunet•com>,
	"David S. Miller" <davem@davemloft•net>
Cc: netdev@vger•kernel.org, Fan Du <fan.du@windriver•com>,
	Andreas Steffen <andreas.steffen@strongswan•org>
Subject: [PATCH ipsec] xfrm: Fix installation of AH IPsec SAs
Date: Thu, 26 Jun 2014 15:12:45 +0200	[thread overview]
Message-ID: <53AC1C4D.3080305@strongswan.org> (raw)

The SPI check introduced in ea9884b3acf3311c8a11db67bfab21773f6f82ba
was intended for IPComp SAs but actually prevented AH SAs from getting
installed (depending on the SPI).

Fixes: ea9884b3acf3 ("xfrm: check user specified spi for IPComp")
Cc: Fan Du <fan.du@windriver•com>
Signed-off-by: Tobias Brunner <tobias@strongswan•org>
---
 net/xfrm/xfrm_user.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 412d9dc..d4db6eb 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -177,9 +177,7 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
 		    attrs[XFRMA_ALG_AEAD]	||
 		    attrs[XFRMA_ALG_CRYPT]	||
 		    attrs[XFRMA_ALG_COMP]	||
-		    attrs[XFRMA_TFCPAD]		||
-		    (ntohl(p->id.spi) >= 0x10000))
-
+		    attrs[XFRMA_TFCPAD])
 			goto out;
 		break;
 
@@ -207,7 +205,8 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
 		    attrs[XFRMA_ALG_AUTH]	||
 		    attrs[XFRMA_ALG_AUTH_TRUNC]	||
 		    attrs[XFRMA_ALG_CRYPT]	||
-		    attrs[XFRMA_TFCPAD])
+		    attrs[XFRMA_TFCPAD]		||
+		    (ntohl(p->id.spi) >= 0x10000))
 			goto out;
 		break;
 
-- 
1.9.1

             reply	other threads:[~2014-06-26 13:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 13:12 Tobias Brunner [this message]
2014-06-30  9:27 ` [PATCH ipsec] xfrm: Fix installation of AH IPsec SAs Steffen Klassert

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=53AC1C4D.3080305@strongswan.org \
    --to=tobias@strongswan$(echo .)org \
    --cc=andreas.steffen@strongswan$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=fan.du@windriver$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=steffen.klassert@secunet$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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