diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index f7226e00b98a..8acd4392fb06 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -3098,6 +3098,8 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, return err; } upe->hard = !!hard; + /* clear the padding bytes */ + memset(&upe->hard + 1, 0, sizeof(*upe) - offsetofend(typeof(*upe), hard)); nlmsg_end(skb, nlh); return 0;