History

Merge tag 'xfs-5.3-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong: - Avoid leaking kernel stack contents to userspace - Fix a potential null pointer dereference in the dabtree scrub code * tag 'xfs-5.3-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: Fix possible null-pointer dereferences in xchk_da_btree_block_check_sibling() xfs: fix stack contents leakage in the v1 inumber ioctls

Linus Torvalds committed 7 years ago

Commit e12b2432 parents b7aea68 afa1d962 files · +8 −1Browse files

Unified · Split

2 files
  1. fs/xfs/scrub/dabtree.c +5 −1
  2. fs/xfs/xfs_itable.c +3 −0
fs/xfs/scrub/dabtree.c+5−1
@@ -278,7 +278,11 @@ xchk_da_btree_block_check_sibling( · 277 unmodified lines
278278 /* Compare upper level pointer to sibling pointer. */
279279 if (ds->state->altpath.blk[level].blkno != sibling)
280280 xchk_da_set_corrupt(ds, level);
281− xfs_trans_brelse(ds->dargs.trans, ds->state->altpath.blk[level].bp);
281+ if (ds->state->altpath.blk[level].bp) {
282+ xfs_trans_brelse(ds->dargs.trans,
283+ ds->state->altpath.blk[level].bp);
284+ ds->state->altpath.blk[level].bp = NULL;
285+ }
282286 out:
283287 return error;
284288 }
fs/xfs/xfs_itable.c+3−0
@@ -272,6 +272,7 @@ xfs_bulkstat_to_bstat( · 271 unmodified lines
272272 struct xfs_bstat *bs1,
273273 const struct xfs_bulkstat *bstat)
274274 {
275+ /* memset is needed here because of padding holes in the structure. */
275276 memset(bs1, 0, sizeof(struct xfs_bstat));
276277 bs1->bs_ino = bstat->bs_ino;
277278 bs1->bs_mode = bstat->bs_mode;
@@ -388,6 +389,8 @@ xfs_inumbers_to_inogrp( · 110 unmodified lines
388389 struct xfs_inogrp *ig1,
389390 const struct xfs_inumbers *ig)
390391 {
392+ /* memset is needed here because of padding holes in the structure. */
393+ memset(ig1, 0, sizeof(struct xfs_inogrp));
391394 ig1->xi_startino = ig->xi_startino;
392395 ig1->xi_alloccount = ig->xi_alloccount;
393396 ig1->xi_allocmask = ig->xi_allocmask;