Re: [PATCH v2] xfsprogs: properly check size arguments for growfs

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

 



On Thu, Nov 14, 2013 at 12:01:30PM -0800, Guangyu Sun wrote:
> xfs_growfs has lowercase options to grow a filesystem as big as possible
> (e.g. the -d option) and uppercase options to grow a filesystem to a
> specified size, expressed in blocks. (e.g. the "-D size" option)
> 
> If the size parameter is not numerical, the parameter is either trimmed or
> ignored. In the latter case, the filesystem is grown as big as possible. This
> may happen when users accidentally specify the size in a format similar to
> mkfs.xfs (e.g. "-D 100m" or "-D size=16384")
> 
> In both cases, xfs_growfs should return an error instead of resizing the
> filesystem.
> 
> To reproduce:
>   # mkfs.xfs -f -d size=20m -L koenfs /dev/dm-3
>   # mount /dev/dm-3 //mnt
>   # xfs_growfs -D 10000andmorethan10invalidcharacters /mnt
>   (...)
>   data blocks changed from 5120 to 10000
>   # xfs_growfs -D invalidargument20000containingnumbers /mnt
>   (...)
>   data blocks changed from 10000 to 19659543
> 
> Reported-by: Koen De Wit <koen.de.wit@xxxxxxxxxx>
> Signed-off-by: Guangyu Sun <guangyu.sun@xxxxxxxxxx>

Perhaps this should be changed to use cvtnum() from libxcmd? That
will fix the input validation problem, and also allow xfs_growfs to
all the different methods of specifying size that we use elsewhere
in xfsprogs...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

_______________________________________________
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