diff options
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 3f565e495ac6..f964d4c00ffb 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -446,7 +446,8 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * | |||
446 | memcpy(&x->sel, &p->sel, sizeof(x->sel)); | 446 | memcpy(&x->sel, &p->sel, sizeof(x->sel)); |
447 | memcpy(&x->lft, &p->lft, sizeof(x->lft)); | 447 | memcpy(&x->lft, &p->lft, sizeof(x->lft)); |
448 | x->props.mode = p->mode; | 448 | x->props.mode = p->mode; |
449 | x->props.replay_window = p->replay_window; | 449 | x->props.replay_window = min_t(unsigned int, p->replay_window, |
450 | sizeof(x->replay.bitmap) * 8); | ||
450 | x->props.reqid = p->reqid; | 451 | x->props.reqid = p->reqid; |
451 | x->props.family = p->family; | 452 | x->props.family = p->family; |
452 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); | 453 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); |
@@ -1856,7 +1857,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1856 | if (x->km.state != XFRM_STATE_VALID) | 1857 | if (x->km.state != XFRM_STATE_VALID) |
1857 | goto out; | 1858 | goto out; |
1858 | 1859 | ||
1859 | err = xfrm_replay_verify_len(x->replay_esn, rp); | 1860 | err = xfrm_replay_verify_len(x->replay_esn, re); |
1860 | if (err) | 1861 | if (err) |
1861 | goto out; | 1862 | goto out; |
1862 | 1863 | ||