netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-2.6 1/4] xfrm: Fix replay window size calculation on initialization
@ 2011-04-26  5:39 Steffen Klassert
  2011-04-26  5:40 ` [PATCH net-2.6 2/4] esp6: Fix scatterlist initialization Steffen Klassert
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Steffen Klassert @ 2011-04-26  5:39 UTC (permalink / raw)
  To: David Miller, Herbert Xu; +Cc: netdev

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


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

end of thread, other threads:[~2011-04-26 19:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [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

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