Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243259
b: refs/heads/master
c: e2b1912
h: refs/heads/master
i:
  243257: 995dd21
  243255: dd72aa6
v: v3
  • Loading branch information
Steffen Klassert authored and David S. Miller committed Mar 29, 2011
1 parent 40a49c2 commit f72f76d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af2f464e326ebad57284cfdecb03f1606e89bbc7
refs/heads/master: e2b19125e94124daaeda1ddcf9b85b04575ad86f
21 changes: 21 additions & 0 deletions trunk/net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,23 @@ static int attach_aead(struct xfrm_algo_aead **algpp, u8 *props,
return 0;
}

static inline int xfrm_replay_verify_len(struct xfrm_replay_state_esn *replay_esn,
struct nlattr *rp)
{
struct xfrm_replay_state_esn *up;

if (!replay_esn || !rp)
return 0;

up = nla_data(rp);

if (xfrm_replay_state_esn_len(replay_esn) !=
xfrm_replay_state_esn_len(up))
return -EINVAL;

return 0;
}

static int xfrm_alloc_replay_state_esn(struct xfrm_replay_state_esn **replay_esn,
struct xfrm_replay_state_esn **preplay_esn,
struct nlattr *rta)
Expand Down Expand Up @@ -1766,6 +1783,10 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
if (x->km.state != XFRM_STATE_VALID)
goto out;

err = xfrm_replay_verify_len(x->replay_esn, rp);
if (err)
goto out;

spin_lock_bh(&x->lock);
xfrm_update_ae_params(x, attrs);
spin_unlock_bh(&x->lock);
Expand Down

0 comments on commit f72f76d

Please sign in to comment.