Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2018-08-06 Thread Al Viro
On Mon, Aug 06, 2018 at 11:45:29AM -0700, Linus Torvalds wrote: > On Mon, Aug 6, 2018 at 10:06 AM Al Viro wrote: > > > > That leaves us with f_bsize and f_frsize (the latter defaulting to the > > former). > > Hugetlbfs can put greater than 4Gb values in there, for really huge pages. > > And

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2018-08-06 Thread Al Viro
On Mon, Aug 06, 2018 at 11:45:29AM -0700, Linus Torvalds wrote: > On Mon, Aug 6, 2018 at 10:06 AM Al Viro wrote: > > > > That leaves us with f_bsize and f_frsize (the latter defaulting to the > > former). > > Hugetlbfs can put greater than 4Gb values in there, for really huge pages. > > And

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2018-08-06 Thread Linus Torvalds
On Mon, Aug 6, 2018 at 10:06 AM Al Viro wrote: > > That leaves us with f_bsize and f_frsize (the latter defaulting to the > former). > Hugetlbfs can put greater than 4Gb values in there, for really huge pages. > And that's the only thing worth checking in there. > > So the whole

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2018-08-06 Thread Linus Torvalds
On Mon, Aug 6, 2018 at 10:06 AM Al Viro wrote: > > That leaves us with f_bsize and f_frsize (the latter defaulting to the > former). > Hugetlbfs can put greater than 4Gb values in there, for really huge pages. > And that's the only thing worth checking in there. > > So the whole

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2018-08-06 Thread Al Viro
On Thu, Oct 05, 2017 at 06:31:29PM -0700, Linus Torvalds wrote: > On Thu, Oct 5, 2017 at 4:06 PM, Al Viro wrote: > > > > Just to make sure we are on the same page: out of kstatfs fields > > we have 5 u64 ones (see above; all of them are u64 is struct statfs64 > > on all architectures), an opaque

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2018-08-06 Thread Al Viro
On Thu, Oct 05, 2017 at 06:31:29PM -0700, Linus Torvalds wrote: > On Thu, Oct 5, 2017 at 4:06 PM, Al Viro wrote: > > > > Just to make sure we are on the same page: out of kstatfs fields > > we have 5 u64 ones (see above; all of them are u64 is struct statfs64 > > on all architectures), an opaque

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Linus Torvalds
On Thu, Oct 5, 2017 at 4:06 PM, Al Viro wrote: > > Just to make sure we are on the same page: out of kstatfs fields > we have 5 u64 ones (see above; all of them are u64 is struct statfs64 > on all architectures), an opaque 64bit f_fsid and 5 fields that > are long: f_type

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Linus Torvalds
On Thu, Oct 5, 2017 at 4:06 PM, Al Viro wrote: > > Just to make sure we are on the same page: out of kstatfs fields > we have 5 u64 ones (see above; all of them are u64 is struct statfs64 > on all architectures), an opaque 64bit f_fsid and 5 fields that > are long: f_type (magic numbers, all

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Al Viro
On Thu, Oct 05, 2017 at 03:31:05PM -0700, Linus Torvalds wrote: > On Thu, Oct 5, 2017 at 1:57 PM, Al Viro wrote: > > > > AFAICS, the real bug here is in hugetlbfs; that's where obscene values in > > ->f_bsize come from. IMO all that code in put_compat_statfs64() should

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Al Viro
On Thu, Oct 05, 2017 at 03:31:05PM -0700, Linus Torvalds wrote: > On Thu, Oct 5, 2017 at 1:57 PM, Al Viro wrote: > > > > AFAICS, the real bug here is in hugetlbfs; that's where obscene values in > > ->f_bsize come from. IMO all that code in put_compat_statfs64() should be > > replaced with > >

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Linus Torvalds
On Thu, Oct 5, 2017 at 1:57 PM, Al Viro wrote: > > AFAICS, the real bug here is in hugetlbfs; that's where obscene values in > ->f_bsize come from. IMO all that code in put_compat_statfs64() should be > replaced with > if (kbuf->bsize != (u32)kbuf->bsize) >

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Linus Torvalds
On Thu, Oct 5, 2017 at 1:57 PM, Al Viro wrote: > > AFAICS, the real bug here is in hugetlbfs; that's where obscene values in > ->f_bsize come from. IMO all that code in put_compat_statfs64() should be > replaced with > if (kbuf->bsize != (u32)kbuf->bsize) > return

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Al Viro
On Thu, Oct 05, 2017 at 09:36:36PM +0300, Sergey Klyaus wrote: > compat_statfs64 structure has some 32-bit and some 64-bit fields, so > 64d2ab32e "vfs: fix put_compat_statfs64() does not handle errors" fixed > 32-bit overflow checks not being performed, but accidentally enabled > checks for

Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Al Viro
On Thu, Oct 05, 2017 at 09:36:36PM +0300, Sergey Klyaus wrote: > compat_statfs64 structure has some 32-bit and some 64-bit fields, so > 64d2ab32e "vfs: fix put_compat_statfs64() does not handle errors" fixed > 32-bit overflow checks not being performed, but accidentally enabled > checks for

[PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Sergey Klyaus
compat_statfs64 structure has some 32-bit and some 64-bit fields, so 64d2ab32e "vfs: fix put_compat_statfs64() does not handle errors" fixed 32-bit overflow checks not being performed, but accidentally enabled checks for f_files and f_ffree that are 64-bit and cannot have overflow. Now checks for

[PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files

2017-10-05 Thread Sergey Klyaus
compat_statfs64 structure has some 32-bit and some 64-bit fields, so 64d2ab32e "vfs: fix put_compat_statfs64() does not handle errors" fixed 32-bit overflow checks not being performed, but accidentally enabled checks for f_files and f_ffree that are 64-bit and cannot have overflow. Now checks for