]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf36d61e01b512b856bdb463b17ca8694b951694d
treec9032b3e27c6e6acb57ec51248468b7b66c8aae0
parentbfe2de5a355e71917b08e947fe3e805ec2f51c71
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: c111b94db0600a2 ("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