xfrm: add missing extack for XFRMA_SA_PCPU in add_acquire and allocspi

We're returning an error caused by invalid user input without setting
an extack. Add one.

Fixes: 1ddf9916ac ("xfrm: Add support for per cpu xfrm state handling.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
Sabrina Dubroca 2026-02-24 00:05:11 +01:00 committed by Steffen Klassert
parent 2f61f38a21
commit aa8a3f3c67

View File

@ -1850,6 +1850,7 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
pcpu_num = nla_get_u32(attrs[XFRMA_SA_PCPU]);
if (pcpu_num >= num_possible_cpus()) {
err = -EINVAL;
NL_SET_ERR_MSG(extack, "pCPU number too big");
goto out_noput;
}
}
@ -3001,8 +3002,10 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh,
if (attrs[XFRMA_SA_PCPU]) {
x->pcpu_num = nla_get_u32(attrs[XFRMA_SA_PCPU]);
err = -EINVAL;
if (x->pcpu_num >= num_possible_cpus())
if (x->pcpu_num >= num_possible_cpus()) {
NL_SET_ERR_MSG(extack, "pCPU number too big");
goto free_state;
}
}
err = verify_newpolicy_info(&ua->policy, extack);