xfs: fix kernel memory exposure problems

Fix a memory exposure problems in inumbers where we allocate an array of
structures with holes, fail to zero the holes, then blindly copy the
kernel memory contents (junk and all) into userspace.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

+1 -1
+1 -1
fs/xfs/xfs_itable.c
··· 583 return error; 584 585 bcount = MIN(left, (int)(PAGE_SIZE / sizeof(*buffer))); 586 - buffer = kmem_alloc(bcount * sizeof(*buffer), KM_SLEEP); 587 do { 588 struct xfs_inobt_rec_incore r; 589 int stat;
··· 583 return error; 584 585 bcount = MIN(left, (int)(PAGE_SIZE / sizeof(*buffer))); 586 + buffer = kmem_zalloc(bcount * sizeof(*buffer), KM_SLEEP); 587 do { 588 struct xfs_inobt_rec_incore r; 589 int stat;