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 4/4] xfrm: Fix integer underrun on zero sized replay windows
Date: Tue, 26 Apr 2011 07:42:32 +0200 [thread overview]
Message-ID: <20110426054232.GI5495@secunet.com> (raw)
In-Reply-To: <20110426053923.GF5495@secunet.com>
The check if the replay window is contained within one subspace or
spans over two subspaces causes an unwanted integer underrun on
zero sized replay windows when we subtract minus one. We fix this by
changeing this check to avoid the subtraction.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_replay.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index e8a7814..19f94bb 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -32,7 +32,7 @@ u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq)
seq_hi = replay_esn->seq_hi;
bottom = replay_esn->seq - replay_esn->replay_window + 1;
- if (likely(replay_esn->seq >= replay_esn->replay_window - 1)) {
+ if (likely(replay_esn->seq > replay_esn->replay_window)) {
/* A. same subspace */
if (unlikely(seq < bottom))
seq_hi++;
--
1.7.0.4
next prev parent reply other threads:[~2011-04-26 5:42 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 ` [PATCH net-2.6 3/4] xfrm: Check for the new replay implementation if an esn state is inserted Steffen Klassert
2011-04-26 5:43 ` Herbert Xu
2011-04-26 19:47 ` David Miller
2011-04-26 5:42 ` Steffen Klassert [this message]
2011-04-26 6:01 ` [PATCH net-2.6 4/4] xfrm: Fix integer underrun on zero sized replay windows 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=20110426054232.GI5495@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).