[0/2] statfs: Enforce statfs[64] structure intialization

Message ID 20230504144021.808932-1-iii@linux.ibm.com
Headers
Series statfs: Enforce statfs[64] structure intialization |

Message

Ilya Leoshkevich May 4, 2023, 2:40 p.m. UTC
  This series fixes copying of uninitialized memory to userspace by
do_statfs_native() and do_statfs64() on s390.

Patch 1 fixes the problem by making the code similar to
put_compat_statfs() and put_compat_statfs64().

Patch 2 gets rid of the padding which caused the issue; even though it
may be considered redundant, it documents that s390 de-facto has an
extra f_spare array element.

Ilya Leoshkevich (2):
  statfs: Enforce statfs[64] structure intialization
  s390/uapi: Cover statfs padding by growing f_spare

 arch/s390/include/asm/compat.h      | 2 +-
 arch/s390/include/uapi/asm/statfs.h | 4 ++--
 fs/statfs.c                         | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
  

Comments

Heiko Carstens May 11, 2023, 2:35 p.m. UTC | #1
On Thu, May 04, 2023 at 04:40:19PM +0200, Ilya Leoshkevich wrote:
> This series fixes copying of uninitialized memory to userspace by
> do_statfs_native() and do_statfs64() on s390.
> 
> Patch 1 fixes the problem by making the code similar to
> put_compat_statfs() and put_compat_statfs64().
> 
> Patch 2 gets rid of the padding which caused the issue; even though it
> may be considered redundant, it documents that s390 de-facto has an
> extra f_spare array element.
> 
> Ilya Leoshkevich (2):
>   statfs: Enforce statfs[64] structure intialization
>   s390/uapi: Cover statfs padding by growing f_spare
> 
>  arch/s390/include/asm/compat.h      | 2 +-
>  arch/s390/include/uapi/asm/statfs.h | 4 ++--
>  fs/statfs.c                         | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)

Al, Andrew, should this go via the s390 tree?
  
Andrew Morton May 12, 2023, 3:45 a.m. UTC | #2
On Thu, 11 May 2023 16:35:15 +0200 Heiko Carstens <hca@linux.ibm.com> wrote:

> On Thu, May 04, 2023 at 04:40:19PM +0200, Ilya Leoshkevich wrote:
> > This series fixes copying of uninitialized memory to userspace by
> > do_statfs_native() and do_statfs64() on s390.
> > 
> > Patch 1 fixes the problem by making the code similar to
> > put_compat_statfs() and put_compat_statfs64().
> > 
> > Patch 2 gets rid of the padding which caused the issue; even though it
> > may be considered redundant, it documents that s390 de-facto has an
> > extra f_spare array element.
> > 
> > Ilya Leoshkevich (2):
> >   statfs: Enforce statfs[64] structure intialization
> >   s390/uapi: Cover statfs padding by growing f_spare
> > 
> >  arch/s390/include/asm/compat.h      | 2 +-
> >  arch/s390/include/uapi/asm/statfs.h | 4 ++--
> >  fs/statfs.c                         | 4 ++--
> >  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> Al, Andrew, should this go via the s390 tree?

I'd say so.
  
Alexander Gordeev May 12, 2023, 12:03 p.m. UTC | #3
On Thu, May 11, 2023 at 08:45:18PM -0700, Andrew Morton wrote:
> On Thu, 11 May 2023 16:35:15 +0200 Heiko Carstens <hca@linux.ibm.com> wrote:
> > Al, Andrew, should this go via the s390 tree?
> 
> I'd say so.

Hi Al,

Any objections if I pull it via the s390 tree?

Thanks!
  
Alexander Gordeev May 15, 2023, 12:40 p.m. UTC | #4
On Thu, May 04, 2023 at 04:40:19PM +0200, Ilya Leoshkevich wrote:
> This series fixes copying of uninitialized memory to userspace by
> do_statfs_native() and do_statfs64() on s390.
> 
> Patch 1 fixes the problem by making the code similar to
> put_compat_statfs() and put_compat_statfs64().
> 
> Patch 2 gets rid of the padding which caused the issue; even though it
> may be considered redundant, it documents that s390 de-facto has an
> extra f_spare array element.
> 
> Ilya Leoshkevich (2):
>   statfs: Enforce statfs[64] structure intialization
>   s390/uapi: Cover statfs padding by growing f_spare
> 
>  arch/s390/include/asm/compat.h      | 2 +-
>  arch/s390/include/uapi/asm/statfs.h | 4 ++--
>  fs/statfs.c                         | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)

Series applied,
Thanks!