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: fix the condition on x->pcpu_num in xfrm_sa_len

pcpu_num = 0 is a valid value. The marker for "unset pcpu_num" which
makes copy_to_user_state_extra not add the XFRMA_SA_PCPU attribute is
UINT_MAX.

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
b57defcf aa8a3f3c

+1 -1
+1 -1
net/xfrm/xfrm_user.c
··· 3676 3676 } 3677 3677 if (x->if_id) 3678 3678 l += nla_total_size(sizeof(x->if_id)); 3679 - if (x->pcpu_num) 3679 + if (x->pcpu_num != UINT_MAX) 3680 3680 l += nla_total_size(sizeof(x->pcpu_num)); 3681 3681 3682 3682 /* Must count x->lastused as it may become non-zero behind our back. */