Re: [PATCH] xfs: fix possible overflow in xfs_ioc_trim()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 05, 2011 at 04:33:25PM +0200, Lukas Czerner wrote:
> In xfs_ioc_trim it is possible that start+len might overflow. Fix it by
> decrementing the len so that start+len equals to the file system size in
> the worst case.

The idea of the check looks reasonable, but I think it needs to be done
a bit different.  Was this caught by the new testcase you just sent?

> +	xfs_fsblock_t		max_blks =  XFS_MAX_DBLOCKS(&(mp->m_sb));

XFS_MAX_DBLOCKS is the maximum number of blocks that the given
geometry could support.  But the last AG could be shorter than the
others.  I think you really want to check against mp->m_sb.sb_dblocks.

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux