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
..
2019-06-28 19:30:43 -07:00
2018-06-06 14:17:53 -07:00
2019-06-28 19:30:43 -07:00
2018-06-06 14:17:53 -07:00
2019-07-15 21:20:52 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-07-02 09:40:05 -07:00
2019-06-28 19:30:43 -07:00
2018-06-06 14:17:53 -07:00
2019-06-28 19:30:43 -07:00
2018-06-06 14:17:53 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-07-12 17:17:51 -07:00
2019-06-30 09:05:17 -07:00
2019-06-28 19:30:43 -07:00
2018-06-06 14:17:53 -07:00
2019-07-04 07:52:23 -07:00
2019-07-04 07:52:23 -07:00
2019-07-04 07:52:23 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-07-03 08:21:58 -07:00
2019-07-03 08:21:58 -07:00
2019-06-28 19:30:43 -07:00
2019-07-04 07:52:23 -07:00
2019-04-23 08:36:23 -07:00
2019-06-28 19:30:43 -07:00
2019-06-30 09:05:17 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2019-06-28 19:30:43 -07:00
2018-06-06 14:17:53 -07:00
2019-06-28 19:30:43 -07:00
2019-06-30 09:05:17 -07:00
2019-06-28 19:30:43 -07:00