linux/fs/xfs/libxfs
Darrick J. Wong 8612de3f7b xfs: don't crash on null attr fork xfs_bmapi_read
Zorro Lang reported a crash in generic/475 if we try to inactivate a
corrupt inode with a NULL attr fork (stack trace shortened somewhat):

RIP: 0010:xfs_bmapi_read+0x311/0xb00 [xfs]
RSP: 0018:ffff888047f9ed68 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff888047f9f038 RCX: 1ffffffff5f99f51
RDX: 0000000000000002 RSI: 0000000000000008 RDI: 0000000000000012
RBP: ffff888002a41f00 R08: ffffed10005483f0 R09: ffffed10005483ef
R10: ffffed10005483ef R11: ffff888002a41f7f R12: 0000000000000004
R13: ffffe8fff53b5768 R14: 0000000000000005 R15: 0000000000000001
FS:  00007f11d44b5b80(0000) GS:ffff888114200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000ef6000 CR3: 000000002e176003 CR4: 00000000001606e0
Call Trace:
 xfs_dabuf_map.constprop.18+0x696/0xe50 [xfs]
 xfs_da_read_buf+0xf5/0x2c0 [xfs]
 xfs_da3_node_read+0x1d/0x230 [xfs]
 xfs_attr_inactive+0x3cc/0x5e0 [xfs]
 xfs_inactive+0x4c8/0x5b0 [xfs]
 xfs_fs_destroy_inode+0x31b/0x8e0 [xfs]
 destroy_inode+0xbc/0x190
 xfs_bulkstat_one_int+0xa8c/0x1200 [xfs]
 xfs_bulkstat_one+0x16/0x20 [xfs]
 xfs_bulkstat+0x6fa/0xf20 [xfs]
 xfs_ioc_bulkstat+0x182/0x2b0 [xfs]
 xfs_file_ioctl+0xee0/0x12a0 [xfs]
 do_vfs_ioctl+0x193/0x1000
 ksys_ioctl+0x60/0x90
 __x64_sys_ioctl+0x6f/0xb0
 do_syscall_64+0x9f/0x4d0
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f11d39a3e5b

The "obvious" cause is that the attr ifork is null despite the inode
claiming an attr fork having at least one extent, but it's not so
obvious why we ended up with an inode in that state.

Reported-by: Zorro Lang <zlang@redhat.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204031
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
2019-08-12 09:32:44 -07:00
..
xfs_ag_resv.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_ag_resv.h xfs: pass transaction lock while setting up agresv on cyclic metadata 2018-07-29 22:37:08 -07:00
xfs_ag.c xfs: account for log space when formatting new AGs 2019-06-28 19:30:21 -07:00
xfs_ag.h xfs: add a new ioctl to describe allocation group geometry 2019-04-14 18:15:57 -07:00
xfs_alloc_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_alloc_btree.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_alloc.c xfs: create iterator error codes 2019-07-02 09:40:05 -07:00
xfs_alloc.h xfs: const-ify xfs_owner_info arguments 2018-12-12 08:47:16 -08:00
xfs_attr_leaf.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_attr_leaf.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr_remote.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_attr_remote.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr_sf.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_attr.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_attr.h xfs: attribute scrub should use seen_enough to pass error values 2019-07-05 10:29:54 -07:00
xfs_bit.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_bit.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_bmap_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_bmap_btree.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_bmap.c xfs: don't crash on null attr fork xfs_bmapi_read 2019-08-12 09:32:44 -07:00
xfs_bmap.h xfs: make COW fork unwritten extent conversions more robust 2019-02-21 07:55:07 -08:00
xfs_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_btree.h xfs: create iterator error codes 2019-07-02 09:40:05 -07:00
xfs_cksum.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xfs_da_btree.c xfs: remove more ondisk directory corruption asserts 2019-08-12 09:32:44 -07:00
xfs_da_btree.h xfs: fold dfops into the transaction 2018-08-02 23:05:14 -07:00
xfs_da_format.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_da_format.h xfs: factor xfs_da3_blkinfo verification into common helper 2019-02-11 16:07:01 -08:00
xfs_defer.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_defer.h xfs: streamline defer op type handling 2018-12-12 08:47:16 -08:00
xfs_dir2_block.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_dir2_data.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_dir2_leaf.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_dir2_node.c xfs: remove more ondisk directory corruption asserts 2019-08-12 09:32:44 -07:00
xfs_dir2_priv.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_dir2_sf.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_dir2.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_dir2.h xfs: check directory name validity 2019-02-11 16:06:40 -08:00
xfs_dquot_buf.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_errortag.h xfs: cache unlinked pointers in an rhashtable 2019-02-11 16:07:01 -08:00
xfs_format.h xfs: move xfs_ino_geometry to xfs_shared.h 2019-06-28 19:25:35 -07:00
xfs_fs.h xfs: allow single bulkstat of special inodes 2019-07-04 07:52:24 -07:00
xfs_health.h xfs: introduce new v5 bulkstat structure 2019-07-03 20:36:26 -07:00
xfs_ialloc_btree.c xfs: create simplified inode walk function 2019-07-02 09:40:05 -07:00
xfs_ialloc_btree.h xfs: create simplified inode walk function 2019-07-02 09:40:05 -07:00
xfs_ialloc.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_ialloc.h xfs: refactor inode geometry setup routines 2019-06-12 08:37:40 -07:00
xfs_iext_tree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_inode_buf.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_inode_buf.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_inode_fork.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_inode_fork.h xfs: update fork seq counter on data fork changes 2019-02-11 16:07:00 -08:00
xfs_log_format.h xfs: refactor unmount record write 2018-07-23 09:08:01 -07:00
xfs_log_recover.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_log_rlimit.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_quota_defs.h xfs: change some error-less functions to void types 2019-05-01 20:26:30 -07:00
xfs_refcount_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_refcount_btree.h xfs: pass transaction lock while setting up agresv on cyclic metadata 2018-07-29 22:37:08 -07:00
xfs_refcount.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_refcount.h xfs: pass transaction to xfs_defer_add() 2018-08-02 23:05:14 -07:00
xfs_rmap_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_rmap_btree.h xfs: pass transaction lock while setting up agresv on cyclic metadata 2018-07-29 22:37:08 -07:00
xfs_rmap.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_rmap.h xfs: remove xfs_rmap_ag_owner and friends 2018-12-12 08:47:16 -08:00
xfs_rtbitmap.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_sb.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_sb.h xfs: change some error-less functions to void types 2019-05-01 20:26:30 -07:00
xfs_shared.h xfs: create iterator error codes 2019-07-02 09:40:05 -07:00
xfs_symlink_remote.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_trans_inode.c xfs: sync up xfs_trans_inode with userspace 2019-07-15 08:10:34 -07:00
xfs_trans_resv.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_trans_resv.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00
xfs_trans_space.h xfs: separate inode geometry 2019-06-12 08:37:40 -07:00
xfs_types.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_types.h xfs: add online scrub for superblock counters 2019-04-30 08:19:13 -07:00