Skip to content

Commit

Permalink
Revert "UPSTREAM: xfrm: Use memset_after() to clear padding"
Browse files Browse the repository at this point in the history
This reverts commit 5266170.
  • Loading branch information
pwnrazr authored and raystef66 committed Jun 1, 2024
1 parent 3405c09 commit fdaa84c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,9 @@ static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family)
xdst = dst_alloc(dst_ops, NULL, 1, DST_OBSOLETE_NONE, 0);

if (likely(xdst)) {
memset_after(xdst, 0, u.dst);
struct dst_entry *dst = &xdst->u.dst;

memset(dst + 1, 0, sizeof(*xdst) - sizeof(*dst));
} else
xdst = ERR_PTR(-ENOBUFS);

Expand Down
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -2803,7 +2803,7 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct
copy_to_user_state(x, &ue->state);
ue->hard = (c->data.hard != 0) ? 1 : 0;
/* clear the padding bytes */
memset_after(ue, 0, hard);
memset(&ue->hard + 1, 0, sizeof(*ue) - offsetofend(typeof(*ue), hard));

err = xfrm_mark_put(skb, &x->mark);
if (err)
Expand Down

0 comments on commit fdaa84c

Please sign in to comment.