mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
6958d11f77
We've had rather rare reports of bmap btree block corruption where the bmap root block has a level count of zero. The root cause of the corruption is so far unknown. We do have verifier checks to detect this form of on-disk corruption, but this doesn't cover a memory corruption variant of the problem. The latter is a reasonable possibility because the root block is part of the inode fork and can reside in-core for some time before inode extents are read. If this occurs, it leads to a system crash such as the following: BUG: unable to handle kernel paging request at ffffffff00000221 PF error: [normal kernel read fault] ... RIP: 0010:xfs_trans_brelse+0xf/0x200 [xfs] ... Call Trace: xfs_iread_extents+0x379/0x540 [xfs] xfs_file_iomap_begin_delay+0x11a/0xb40 [xfs] ? xfs_attr_get+0xd1/0x120 [xfs] ? iomap_write_begin.constprop.40+0x2d0/0x2d0 xfs_file_iomap_begin+0x4c4/0x6d0 [xfs] ? __vfs_getxattr+0x53/0x70 ? iomap_write_begin.constprop.40+0x2d0/0x2d0 iomap_apply+0x63/0x130 ? iomap_write_begin.constprop.40+0x2d0/0x2d0 iomap_file_buffered_write+0x62/0x90 ? iomap_write_begin.constprop.40+0x2d0/0x2d0 xfs_file_buffered_aio_write+0xe4/0x3b0 [xfs] __vfs_write+0x150/0x1b0 vfs_write+0xba/0x1c0 ksys_pwrite64+0x64/0xa0 do_syscall_64+0x5a/0x1d0 entry_SYSCALL_64_after_hwframe+0x49/0xbe The crash occurs because xfs_iread_extents() attempts to release an uninitialized buffer pointer as the level == 0 value prevented the buffer from ever being allocated or read. Change the level > 0 assert to an explicit error check in xfs_iread_extents() to avoid crashing the kernel in the event of localized, in-core inode corruption. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> |
||
---|---|---|
.. | ||
xfs_ag_resv.c | ||
xfs_ag_resv.h | ||
xfs_ag.c | ||
xfs_ag.h | ||
xfs_alloc_btree.c | ||
xfs_alloc_btree.h | ||
xfs_alloc.c | ||
xfs_alloc.h | ||
xfs_attr_leaf.c | ||
xfs_attr_leaf.h | ||
xfs_attr_remote.c | ||
xfs_attr_remote.h | ||
xfs_attr_sf.h | ||
xfs_attr.c | ||
xfs_attr.h | ||
xfs_bit.c | ||
xfs_bit.h | ||
xfs_bmap_btree.c | ||
xfs_bmap_btree.h | ||
xfs_bmap.c | ||
xfs_bmap.h | ||
xfs_btree.c | ||
xfs_btree.h | ||
xfs_cksum.h | ||
xfs_da_btree.c | ||
xfs_da_btree.h | ||
xfs_da_format.c | ||
xfs_da_format.h | ||
xfs_defer.c | ||
xfs_defer.h | ||
xfs_dir2_block.c | ||
xfs_dir2_data.c | ||
xfs_dir2_leaf.c | ||
xfs_dir2_node.c | ||
xfs_dir2_priv.h | ||
xfs_dir2_sf.c | ||
xfs_dir2.c | ||
xfs_dir2.h | ||
xfs_dquot_buf.c | ||
xfs_errortag.h | ||
xfs_format.h | ||
xfs_fs.h | ||
xfs_ialloc_btree.c | ||
xfs_ialloc_btree.h | ||
xfs_ialloc.c | ||
xfs_ialloc.h | ||
xfs_iext_tree.c | ||
xfs_inode_buf.c | ||
xfs_inode_buf.h | ||
xfs_inode_fork.c | ||
xfs_inode_fork.h | ||
xfs_log_format.h | ||
xfs_log_recover.h | ||
xfs_log_rlimit.c | ||
xfs_quota_defs.h | ||
xfs_refcount_btree.c | ||
xfs_refcount_btree.h | ||
xfs_refcount.c | ||
xfs_refcount.h | ||
xfs_rmap_btree.c | ||
xfs_rmap_btree.h | ||
xfs_rmap.c | ||
xfs_rmap.h | ||
xfs_rtbitmap.c | ||
xfs_sb.c | ||
xfs_sb.h | ||
xfs_shared.h | ||
xfs_symlink_remote.c | ||
xfs_trans_resv.c | ||
xfs_trans_resv.h | ||
xfs_trans_space.h | ||
xfs_types.c | ||
xfs_types.h |