|
@@ -796,7 +796,7 @@ static int copy_user_offload(struct xfrm_state_offload *xso, struct sk_buff *skb
|
|
|
return -EMSGSIZE;
|
|
|
|
|
|
xuo = nla_data(attr);
|
|
|
-
|
|
|
+ memset(xuo, 0, sizeof(*xuo));
|
|
|
xuo->ifindex = xso->dev->ifindex;
|
|
|
xuo->flags = xso->flags;
|
|
|
|
|
@@ -1869,6 +1869,7 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct
|
|
|
return -EMSGSIZE;
|
|
|
|
|
|
id = nlmsg_data(nlh);
|
|
|
+ memset(&id->sa_id, 0, sizeof(id->sa_id));
|
|
|
memcpy(&id->sa_id.daddr, &x->id.daddr, sizeof(x->id.daddr));
|
|
|
id->sa_id.spi = x->id.spi;
|
|
|
id->sa_id.family = x->props.family;
|
|
@@ -2578,6 +2579,8 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct
|
|
|
ue = nlmsg_data(nlh);
|
|
|
copy_to_user_state(x, &ue->state);
|
|
|
ue->hard = (c->data.hard != 0) ? 1 : 0;
|
|
|
+ /* clear the padding bytes */
|
|
|
+ memset(&ue->hard + 1, 0, sizeof(*ue) - offsetofend(typeof(*ue), hard));
|
|
|
|
|
|
err = xfrm_mark_put(skb, &x->mark);
|
|
|
if (err)
|
|
@@ -2715,6 +2718,7 @@ static int xfrm_notify_sa(struct xfrm_state *x, const struct km_event *c)
|
|
|
struct nlattr *attr;
|
|
|
|
|
|
id = nlmsg_data(nlh);
|
|
|
+ memset(id, 0, sizeof(*id));
|
|
|
memcpy(&id->daddr, &x->id.daddr, sizeof(id->daddr));
|
|
|
id->spi = x->id.spi;
|
|
|
id->family = x->props.family;
|