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 1/4] xfrm: Fix replay window size calculation on initialization
Date: Tue, 26 Apr 2011 07:39:24 +0200 [thread overview]
Message-ID: <20110426053923.GF5495@secunet.com> (raw)
On replay initialization, we compute the size of the replay
buffer to see if the replay window fits into the buffer.
This computation lacks a mutliplication by 8 because we need
the size in bit, not in byte. So we might return an error
even though the replay window would fit into the buffer.
This patch fixes this issue.
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 f218385..e8a7814 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -532,7 +532,7 @@ int xfrm_init_replay(struct xfrm_state *x)
if (replay_esn) {
if (replay_esn->replay_window >
- replay_esn->bmp_len * sizeof(__u32))
+ replay_esn->bmp_len * sizeof(__u32) * 8)
return -EINVAL;
if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn)
--
1.7.0.4
next reply other threads:[~2011-04-26 5:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 5:39 Steffen Klassert [this message]
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 ` [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=20110426053923.GF5495@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.