linux/fs/xfs/libxfs
Darrick J. Wong c94613feef xfs: fix maxicount division by zero error
In xfs_ialloc_setup_geometry, it's possible for a malicious/corrupt fs
image to set an unreasonably large value for sb_inopblog which will
cause ialloc_blks to be zero.  If sb_imax_pct is also set, this results
in a division by zero error in the second do_div call.  Therefore, force
maxicount to zero if ialloc_blks is zero.

Note that the kernel metadata verifiers will catch the garbage inopblog
value and abort the fs mount long before it tries to set up the inode
geometry; this is needed to avoid a crash in xfs_db while setting up the
xfs_mount structure.

Found by fuzzing sb_inopblog to 122 in xfs/350.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
2019-08-28 08:31:01 -07:00
..
xfs_ag_resv.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_ag_resv.h
xfs_ag.c xfs: account for log space when formatting new AGs 2019-06-28 19:30:21 -07:00
xfs_ag.h
xfs_alloc_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_alloc_btree.h
xfs_alloc.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_alloc.h
xfs_attr_leaf.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_attr_leaf.h
xfs_attr_remote.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_attr_remote.h
xfs_attr_sf.h
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_bmap_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_bmap_btree.h
xfs_bmap.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_bmap.h
xfs_btree.c xfs: remove excess function parameter description in 'xfs_btree_sblock_v5hdr_verify' 2019-08-26 17:43:15 -07:00
xfs_btree.h xfs: create iterator error codes 2019-07-02 09:40:05 -07:00
xfs_cksum.h
xfs_da_btree.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_da_btree.h
xfs_da_format.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_da_format.h
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 fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -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_dir2_sf.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_dir2.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_dir2.h
xfs_dquot_buf.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_errortag.h
xfs_format.h
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: fix maxicount division by zero error 2019-08-28 08:31:01 -07:00
xfs_ialloc.h
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_inode_fork.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_inode_fork.h
xfs_log_format.h
xfs_log_recover.h
xfs_log_rlimit.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_quota_defs.h
xfs_refcount_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_refcount_btree.h
xfs_refcount.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_refcount.h
xfs_rmap_btree.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_rmap_btree.h
xfs_rmap.c fs: xfs: Remove KM_NOSLEEP and KM_SLEEP. 2019-08-26 12:06:22 -07:00
xfs_rmap.h
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_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_trans_space.h
xfs_types.c xfs: remove unused header files 2019-06-28 19:30:43 -07:00
xfs_types.h xfs: add kmem allocation trace points 2019-08-26 17:43:14 -07:00