Message ID | 20110426053923.GF5495@secunet.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Tue, Apr 26, 2011 at 07:39:24AM +0200, Steffen Klassert wrote: > 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> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au> Date: Tue, 26 Apr 2011 15:41:07 +1000 > On Tue, Apr 26, 2011 at 07:39:24AM +0200, Steffen Klassert wrote: >> 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> > > Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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)
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(-)