--- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -2275,6 +2275,9 @@ static int xfrm_add_acquire(struct sk_bu err = verify_newpolicy_info(&ua->policy); if (err) goto free_state; + err = verify_sec_ctx_len(attrs); + if (err) + goto free_state; /* build an XP */ xp = xfrm_policy_construct(net, &ua->policy, attrs, &err);