netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org
Subject: [PATCH net-2.6 3/4] xfrm: Check for the new replay implementation if an esn state is inserted
Date: Tue, 26 Apr 2011 07:41:21 +0200	[thread overview]
Message-ID: <20110426054121.GH5495@secunet.com> (raw)
In-Reply-To: <20110426053923.GF5495@secunet.com>

IPsec extended sequence numbers can be used only with the new
anti-replay window implementation. So check if the new implementation
is used if an esn state is inserted and return an error if it is not.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_user.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 5d1d60d..c658cb3 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -124,6 +124,9 @@ static inline int verify_replay(struct xfrm_usersa_info *p,
 {
 	struct nlattr *rt = attrs[XFRMA_REPLAY_ESN_VAL];
 
+	if ((p->flags & XFRM_STATE_ESN) && !rt)
+		return -EINVAL;
+
 	if (!rt)
 		return 0;
 
-- 
1.7.0.4


  parent reply	other threads:[~2011-04-26  5:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26  5:39 [PATCH net-2.6 1/4] xfrm: Fix replay window size calculation on initialization Steffen Klassert
2011-04-26  5:40 ` [PATCH net-2.6 2/4] esp6: Fix scatterlist initialization Steffen Klassert
2011-04-26  5:41   ` Herbert Xu
2011-04-26 19:47     ` David Miller
2011-04-26  5:41 ` [PATCH net-2.6 1/4] xfrm: Fix replay window size calculation on initialization Herbert Xu
2011-04-26 19:47   ` David Miller
2011-04-26  5:41 ` Steffen Klassert [this message]
2011-04-26  5:43   ` [PATCH net-2.6 3/4] xfrm: Check for the new replay implementation if an esn state is inserted Herbert Xu
2011-04-26 19:47     ` David Miller
2011-04-26  5:42 ` [PATCH net-2.6 4/4] xfrm: Fix integer underrun on zero sized replay windows Steffen Klassert
2011-04-26  6:01   ` Herbert Xu
2011-04-26 10:58   ` Steffen Klassert
2011-04-26 19:48     ` 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=20110426054121.GH5495@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@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).