Skip to content

Commit 125eac2

Browse files
committed
xfs: initialize the shortform attr header padding entry
Don't leak kernel memory contents into the shortform attr fork. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent f402043 commit 125eac2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/xfs/libxfs/xfs_attr_leaf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,8 @@ xfs_attr_shortform_create(
653653
ASSERT(ifp->if_flags & XFS_IFINLINE);
654654
}
655655
xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK);
656-
hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data;
657-
hdr->count = 0;
656+
hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data;
657+
memset(hdr, 0, sizeof(*hdr));
658658
hdr->totsize = cpu_to_be16(sizeof(*hdr));
659659
xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA);
660660
}

0 commit comments

Comments
 (0)