netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ipsec] xfrm: Fix installation of AH IPsec SAs
@ 2014-06-26 13:12 Tobias Brunner
  2014-06-30  9:27 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Brunner @ 2014-06-26 13:12 UTC (permalink / raw)
  To: Steffen Klassert, David S. Miller; +Cc: netdev, Fan Du, Andreas Steffen

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH ipsec] xfrm: Fix installation of AH IPsec SAs
  2014-06-26 13:12 [PATCH ipsec] xfrm: Fix installation of AH IPsec SAs Tobias Brunner
@ 2014-06-30  9:27 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2014-06-30  9:27 UTC (permalink / raw)
  To: Tobias Brunner; +Cc: David S. Miller, netdev, Fan Du, Andreas Steffen

On Thu, Jun 26, 2014 at 03:12:45PM +0200, Tobias Brunner wrote:
> The SPI check introduced in ea9884b3acf3311c8a11db67bfab21773f6f82ba
> was intended for IPComp SAs but actually prevented AH SAs from getting
> installed (depending on the SPI).

Yes, this patch was apparently wrong.

> 
> Fixes: ea9884b3acf3 ("xfrm: check user specified spi for IPComp")
> Cc: Fan Du <fan.du@windriver.com>
> Signed-off-by: Tobias Brunner <tobias@strongswan.org>

Applied to the ipsec tree, thanks a lot Tobias!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-30  9:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-26 13:12 [PATCH ipsec] xfrm: Fix installation of AH IPsec SAs Tobias Brunner
2014-06-30  9:27 ` Steffen Klassert

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).