Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-17 Thread David Sterba
On Fri, May 13, 2016 at 04:57:17PM -0700, Liu Bo wrote: > > > + chunk)); > > > + return -EIO; > > > + } > > > if (!length || !IS_ALIGNED(length, root->sectorsize)) { > > > btrfs_err(root->fs_info, > > >

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-13 Thread Liu Bo
On Wed, May 04, 2016 at 03:56:26PM +0200, David Sterba wrote: > A few minor comments below > > On Mon, May 02, 2016 at 11:15:51AM -0700, Liu Bo wrote: > > --- a/fs/btrfs/volumes.c > > +++ b/fs/btrfs/volumes.c > > @@ -6206,27 +6206,23 @@ struct btrfs_device *btrfs_alloc_device(struct > > btrfs_fs_

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-04 Thread Qu Wenruo
Liu Bo wrote on 2016/05/03 16:36 -0700: On Tue, May 03, 2016 at 09:12:01AM +0800, Qu Wenruo wrote: Liu Bo wrote on 2016/05/02 11:15 -0700: To prevent fuzz filesystem images from panic the whole system, we need various validation checks to refuse to mount such an image if btrfs finds any inv

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-04 Thread David Sterba
A few minor comments below On Mon, May 02, 2016 at 11:15:51AM -0700, Liu Bo wrote: > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -6206,27 +6206,23 @@ struct btrfs_device *btrfs_alloc_device(struct > btrfs_fs_info *fs_info, > return dev; > } > > -static int read_one_chunk(str

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-03 Thread Liu Bo
On Tue, May 03, 2016 at 09:12:01AM +0800, Qu Wenruo wrote: > > > Liu Bo wrote on 2016/05/02 11:15 -0700: > >To prevent fuzz filesystem images from panic the whole system, > >we need various validation checks to refuse to mount such an image > >if btrfs finds any invalid value during loading chunk

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-03 Thread Liu Bo
On Tue, May 03, 2016 at 01:53:02PM +0800, Anand Jain wrote: > > > > On 05/03/2016 02:15 AM, Liu Bo wrote: > >To prevent fuzz filesystem images from panic the whole system, > >we need various validation checks to refuse to mount such an image > >if btrfs finds any invalid value during loading chu

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-02 Thread Anand Jain
On 05/03/2016 02:15 AM, Liu Bo wrote: To prevent fuzz filesystem images from panic the whole system, we need various validation checks to refuse to mount such an image if btrfs finds any invalid value during loading chunks, including both sys_array and regular chunks. Note that these checks m

Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading

2016-05-02 Thread Qu Wenruo
Liu Bo wrote on 2016/05/02 11:15 -0700: To prevent fuzz filesystem images from panic the whole system, we need various validation checks to refuse to mount such an image if btrfs finds any invalid value during loading chunks, including both sys_array and regular chunks. Note that these checks