Commit e12b243d authored by Linus Torvalds's avatar Linus Torvalds

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
parents b7aea68a afa1d96d
...@@ -278,7 +278,11 @@ xchk_da_btree_block_check_sibling( ...@@ -278,7 +278,11 @@ xchk_da_btree_block_check_sibling(
/* Compare upper level pointer to sibling pointer. */ /* Compare upper level pointer to sibling pointer. */
if (ds->state->altpath.blk[level].blkno != sibling) if (ds->state->altpath.blk[level].blkno != sibling)
xchk_da_set_corrupt(ds, level); xchk_da_set_corrupt(ds, level);
xfs_trans_brelse(ds->dargs.trans, ds->state->altpath.blk[level].bp); if (ds->state->altpath.blk[level].bp) {
xfs_trans_brelse(ds->dargs.trans,
ds->state->altpath.blk[level].bp);
ds->state->altpath.blk[level].bp = NULL;
}
out: out:
return error; return error;
} }
......
...@@ -272,6 +272,7 @@ xfs_bulkstat_to_bstat( ...@@ -272,6 +272,7 @@ xfs_bulkstat_to_bstat(
struct xfs_bstat *bs1, struct xfs_bstat *bs1,
const struct xfs_bulkstat *bstat) const struct xfs_bulkstat *bstat)
{ {
/* memset is needed here because of padding holes in the structure. */
memset(bs1, 0, sizeof(struct xfs_bstat)); memset(bs1, 0, sizeof(struct xfs_bstat));
bs1->bs_ino = bstat->bs_ino; bs1->bs_ino = bstat->bs_ino;
bs1->bs_mode = bstat->bs_mode; bs1->bs_mode = bstat->bs_mode;
...@@ -388,6 +389,8 @@ xfs_inumbers_to_inogrp( ...@@ -388,6 +389,8 @@ xfs_inumbers_to_inogrp(
struct xfs_inogrp *ig1, struct xfs_inogrp *ig1,
const struct xfs_inumbers *ig) const struct xfs_inumbers *ig)
{ {
/* memset is needed here because of padding holes in the structure. */
memset(ig1, 0, sizeof(struct xfs_inogrp));
ig1->xi_startino = ig->xi_startino; ig1->xi_startino = ig->xi_startino;
ig1->xi_alloccount = ig->xi_alloccount; ig1->xi_alloccount = ig->xi_alloccount;
ig1->xi_allocmask = ig->xi_allocmask; ig1->xi_allocmask = ig->xi_allocmask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment