Skip to content

Commit b57defc

Browse files
qsnklassert
authored andcommitted
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: 1ddf991 ("xfrm: Add support for per cpu xfrm state handling.") Signed-off-by: Sabrina Dubroca <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent aa8a3f3 commit b57defc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/xfrm/xfrm_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3676,7 +3676,7 @@ static inline unsigned int xfrm_sa_len(struct xfrm_state *x)
36763676
}
36773677
if (x->if_id)
36783678
l += nla_total_size(sizeof(x->if_id));
3679-
if (x->pcpu_num)
3679+
if (x->pcpu_num != UINT_MAX)
36803680
l += nla_total_size(sizeof(x->pcpu_num));
36813681

36823682
/* Must count x->lastused as it may become non-zero behind our back. */

0 commit comments

Comments
 (0)