linux/fs/xfs/libxfs
Darrick J. Wong 1cb5deb5bc xfs: don't ever return a stale pointer from __xfs_dir3_free_read
If we decide that a directory free block is corrupt, we must take care
not to leak a buffer pointer to the caller.  After xfs_trans_brelse
returns, the buffer can be freed or reused, which means that we have to
set *bpp back to NULL.

Callers are supposed to notice the nonzero return value and not use the
buffer pointer, but we should code more defensively, even if all current
callers handle this situation correctly.

Fixes: de14c5f541 ("xfs: verify free block header fields")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2020-03-12 07:58:12 -07:00
..
xfs_ag_resv.c xfs: fix missing header includes 2019-11-07 13:00:53 -08:00
xfs_ag_resv.h
xfs_ag.c xfs: remove XFS_BUF_TO_SBP 2020-03-11 09:11:39 -07:00
xfs_ag.h
xfs_alloc_btree.c xfs: remove XFS_BUF_TO_AGF 2020-03-11 09:11:39 -07:00
xfs_alloc_btree.h
xfs_alloc.c xfs: add a function to deal with corrupt buffers post-verifiers 2020-03-12 07:58:12 -07:00
xfs_alloc.h xfs: remove the agfl_bno member from struct xfs_agfl 2020-03-11 09:11:38 -07:00
xfs_attr_leaf.c xfs: add a function to deal with corrupt buffers post-verifiers 2020-03-12 07:58:12 -07:00
xfs_attr_leaf.h xfs: embedded the attrlist cursor into struct xfs_attr_list_context 2020-03-02 20:55:55 -08:00
xfs_attr_remote.c xfs: remove ATTR_KERNOVAL 2020-03-02 20:55:53 -08:00
xfs_attr_remote.h xfs: refactor remote attr value buffer invalidation 2020-01-16 08:07:23 -08:00
xfs_attr_sf.h
xfs_attr.c xfs: remove XFS_DA_OP_INCOMPLETE 2020-03-02 20:55:55 -08:00
xfs_attr.h xfs: embedded the attrlist cursor into struct xfs_attr_list_context 2020-03-02 20:55:55 -08:00
xfs_bit.c xfs: fix missing header includes 2019-11-07 13:00:53 -08:00
xfs_bit.h
xfs_bmap_btree.c xfs: fix sign handling problem in xfs_bmbt_diff_two_keys 2019-08-28 08:31:01 -07:00
xfs_bmap_btree.h
xfs_bmap.c xfs: open code insert range extent split helper 2020-03-02 20:55:51 -08:00
xfs_bmap.h xfs: open code insert range extent split helper 2020-03-02 20:55:51 -08:00
xfs_btree.c xfs: add a function to deal with corrupt buffers post-verifiers 2020-03-12 07:58:12 -07:00
xfs_btree.h xfs: remove the xfs_btree_get_buf[ls] functions 2020-01-26 14:32:26 -08:00
xfs_cksum.h
xfs_da_btree.c xfs: add a function to deal with corrupt buffers post-verifiers 2020-03-12 07:58:12 -07:00
xfs_da_btree.h xfs: remove XFS_DA_OP_INCOMPLETE 2020-03-02 20:55:55 -08:00
xfs_da_format.h xfs: clean up the attr flag confusion 2020-03-02 20:55:55 -08:00
xfs_defer.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_defer.h
xfs_dir2_block.c xfs: remove the mappedbno argument to xfs_da_read_buf 2019-11-22 08:17:10 -08:00
xfs_dir2_data.c xfs: remove the mappedbno argument to xfs_da_get_buf 2019-11-22 08:17:10 -08:00
xfs_dir2_leaf.c xfs: add a function to deal with corrupt buffers post-verifiers 2020-03-12 07:58:12 -07:00
xfs_dir2_node.c xfs: don't ever return a stale pointer from __xfs_dir3_free_read 2020-03-12 07:58:12 -07:00
xfs_dir2_priv.h libxfs: resync with the userspace libxfs 2019-12-19 07:53:47 -08:00
xfs_dir2_sf.c libxfs: resync with the userspace libxfs 2019-12-19 07:53:47 -08:00
xfs_dir2.c libxfs: resync with the userspace libxfs 2019-12-19 07:53:47 -08:00
xfs_dir2.h xfs: Fix deadlock between AGI and AGF when target_ip exists in xfs_rename() 2019-11-13 11:13:45 -08:00
xfs_dquot_buf.c xfs: remove the xfs_disk_dquot_t and xfs_dquot_t 2019-11-13 11:13:45 -08:00
xfs_errortag.h
xfs_format.h xfs: remove XFS_BUF_TO_SBP 2020-03-11 09:11:39 -07:00
xfs_fs.h xfs: clean up the attr flag confusion 2020-03-02 20:55:55 -08:00
xfs_health.h xfs: introduce new v5 bulkstat structure 2019-07-03 20:36:26 -07:00
xfs_ialloc_btree.c xfs: remove XFS_BUF_TO_AGI 2020-03-11 09:11:38 -07:00
xfs_ialloc_btree.h
xfs_ialloc.c xfs: remove XFS_BUF_TO_AGI 2020-03-11 09:11:38 -07:00
xfs_ialloc.h xfs: don't commit sunit/swidth updates to disk if that would cause repair failures 2019-12-19 07:53:48 -08:00
xfs_iext_tree.c xfs: fix inode fork extent count overflow 2019-10-21 09:04:58 -07:00
xfs_inode_buf.c xfs: remove the kuid/kgid conversion wrappers 2020-03-02 20:55:50 -08:00
xfs_inode_buf.h xfs: remove the icdinode di_uid/di_gid members 2020-03-02 20:55:50 -08:00
xfs_inode_fork.c xfs: Remove kmem_zone_free() wrapper 2019-11-18 08:40:44 -08:00
xfs_inode_fork.h xfs: refactor "does this fork map blocks" predicate 2019-11-10 10:22:51 -08:00
xfs_log_format.h xfs: make struct xfs_buf_log_format have a consistent size 2020-01-16 08:07:23 -08:00
xfs_log_recover.h xfs: remove unused typedef definitions 2019-11-13 18:22:40 -08:00
xfs_log_rlimit.c
xfs_quota_defs.h
xfs_refcount_btree.c xfs: remove XFS_BUF_TO_AGF 2020-03-11 09:11:39 -07:00
xfs_refcount_btree.h
xfs_refcount.c xfs: remove unnecessary null pointer checks from _read_agf callers 2020-01-26 14:32:27 -08:00
xfs_refcount.h xfs: remove unnecessary int returns from deferred refcount functions 2019-08-28 08:31:02 -07:00
xfs_rmap_btree.c xfs: remove XFS_BUF_TO_AGF 2020-03-11 09:11:39 -07:00
xfs_rmap_btree.h
xfs_rmap.c xfs: fix xfs_rmap_has_other_keys usage of ECANCELED 2020-03-12 07:58:12 -07:00
xfs_rmap.h xfs: reinitialize rm_flags when unpacking an offset into an rmap irec 2019-08-28 08:31:02 -07:00
xfs_rtbitmap.c xfs: convert open coded corruption check to use XFS_IS_CORRUPT 2019-11-13 11:08:01 -08:00
xfs_sb.c xfs: remove XFS_BUF_TO_SBP 2020-03-11 09:11:39 -07:00
xfs_sb.h
xfs_shared.h xfs: remove all *_ITER_CONTINUE values 2019-08-30 22:43:56 -07:00
xfs_symlink_remote.c
xfs_trans_inode.c xfs: use a struct timespec64 for the in-core crtime 2019-11-13 11:13:45 -08:00
xfs_trans_resv.c xfs: Make the symbol 'xfs_rtalloc_log_count' static 2019-12-20 08:07:31 -08:00
xfs_trans_resv.h
xfs_trans_space.h
xfs_types.c
xfs_types.h xfs: remove unused structure members & simple typedefs 2019-11-13 18:22:41 -08:00