linux/fs/xfs/scrub
Jia-Ju Bai afa1d96d14 xfs: Fix possible null-pointer dereferences in xchk_da_btree_block_check_sibling()
In xchk_da_btree_block_check_sibling(), there is an if statement on
line 274 to check whether ds->state->altpath.blk[level].bp is NULL:
    if (ds->state->altpath.blk[level].bp)

When ds->state->altpath.blk[level].bp is NULL, it is used on line 281:
    xfs_trans_brelse(..., ds->state->altpath.blk[level].bp);
        struct xfs_buf_log_item *bip = bp->b_log_item;
        ASSERT(bp->b_transp == tp);

Thus, possible null-pointer dereferences may occur.

To fix these bugs, ds->state->altpath.blk[level].bp is checked before
being used.

These bugs are found by a static analysis tool STCheck written by us.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2019-07-30 11:28:20 -07:00
..
agheader.c xfs: create iterator error codes 2019-07-02 09:40:05 -07:00
agheader_repair.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
alloc.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
attr.c xfs: online scrub needn't bother zeroing its temporary buffer 2019-07-05 10:29:56 -07:00
attr.h xfs: only allocate memory for scrubbing attributes when we need it 2019-07-05 10:29:56 -07:00
bitmap.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
bitmap.h
bmap.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
btree.h
common.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
common.h
dabtree.c xfs: Fix possible null-pointer dereferences in xchk_da_btree_block_check_sibling() 2019-07-30 11:28:20 -07:00
dabtree.h
dir.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
fscounters.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
health.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
health.h
ialloc.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
inode.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
parent.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
quota.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
refcount.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
repair.c xfs: create iterator error codes 2019-07-02 09:40:05 -07:00
repair.h
rmap.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
rtbitmap.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
scrub.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
scrub.h
symlink.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
trace.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
trace.h
xfs_scrub.h