xfs: fix stack contents leakage in the v1 inumber ioctls
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 29 Jul 2019 04:12:32 +0000 (21:12 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 29 Jul 2019 04:12:32 +0000 (21:12 -0700)
commit2e616d9f9ce8d469db4cd0a019cdc2ff3feab577
treec9032b3e27c6e6acb57ec51248468b7b66c8aae0
parent609488bc979f99f805f34e9a32c1e3b71179d10b
xfs: fix stack contents leakage in the v1 inumber ioctls

Explicitly initialize the onstack structures to zero so we don't leak
kernel memory into userspace when converting the in-core inumbers
structure to the v1 inogrp ioctl structure.  Add a comment about why we
have to use memset to ensure that the padding holes in the structures
are set to zero.

Fixes: 5f19c7fc6873351 ("xfs: introduce v5 inode group structure")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
fs/xfs/xfs_itable.c