xfs: prevent reading uninitialized stack memory
authorDan Rosenberg <dan.j.rosenberg@gmail.com>
Mon, 6 Sep 2010 22:24:57 +0000 (18:24 -0400)
committerAlex Elder <aelder@sgi.com>
Fri, 10 Sep 2010 12:39:28 +0000 (07:39 -0500)
commita122eb2fdfd78b58c6dd992d6f4b1aaef667eef9
tree754cbb6319fd3114c6aeb1bf456bf37cff699c69
parentcc491e27d31f1bb3dacb309407b47d65669ceb9d
xfs: prevent reading uninitialized stack memory

The XFS_IOC_FSGETXATTR ioctl allows unprivileged users to read 12
bytes of uninitialized stack memory, because the fsxattr struct
declared on the stack in xfs_ioc_fsgetxattr() does not alter (or zero)
the 12-byte fsx_pad member before copying it back to the user.  This
patch takes care of it.

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/linux-2.6/xfs_ioctl.c