mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-05 12:43:09 +09:00
xfs: prevent reading uninitialized stack memory
commit a122eb2fdf upstream.
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>
Cc: dann frazier <dannf@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
db1a0b94ba
commit
043d7866ae
@@ -789,6 +789,8 @@ xfs_ioc_fsgetxattr(
|
||||
{
|
||||
struct fsxattr fa;
|
||||
|
||||
memset(&fa, 0, sizeof(struct fsxattr));
|
||||
|
||||
xfs_ilock(ip, XFS_ILOCK_SHARED);
|
||||
fa.fsx_xflags = xfs_ip2xflags(ip);
|
||||
fa.fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
|
||||
|
||||
Reference in New Issue
Block a user