Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 1ddf9916ac09 ("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>

authored by

Sabrina Dubroca and committed by
Steffen Klassert
aa8a3f3c 2f61f38a

+4 -1
+4 -1
net/xfrm/xfrm_user.c
··· 1850 1850 pcpu_num = nla_get_u32(attrs[XFRMA_SA_PCPU]); 1851 1851 if (pcpu_num >= num_possible_cpus()) { 1852 1852 err = -EINVAL; 1853 + NL_SET_ERR_MSG(extack, "pCPU number too big"); 1853 1854 goto out_noput; 1854 1855 } 1855 1856 } ··· 3002 3001 if (attrs[XFRMA_SA_PCPU]) { 3003 3002 x->pcpu_num = nla_get_u32(attrs[XFRMA_SA_PCPU]); 3004 3003 err = -EINVAL; 3005 - if (x->pcpu_num >= num_possible_cpus()) 3004 + if (x->pcpu_num >= num_possible_cpus()) { 3005 + NL_SET_ERR_MSG(extack, "pCPU number too big"); 3006 3006 goto free_state; 3007 + } 3007 3008 } 3008 3009 3009 3010 err = verify_newpolicy_info(&ua->policy, extack);