diff options
author | Dan Rosenberg <drosenberg@vsecurity.com> | 2011-02-14 21:45:00 +0100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2012-04-09 14:24:11 +0200 |
commit | 0271393ea48eb1b7f5ac0309683c50dd98cd6ab9 (patch) | |
tree | 57d57d10e3ee6efa38436fcfc2b183c905db4e47 | |
parent | 9a38dd0b5527eab772d2a2969e72d67666b029d6 (diff) | |
download | linux-2.4-0271393ea48eb1b7f5ac0309683c50dd98cd6ab9.tar.gz |
xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1
The FSGEOMETRY_V1 ioctl (and its compat equivalent) calls out to
xfs_fs_geometry() with a version number of 3. This code path does not
fill in the logsunit member of the passed xfs_fsop_geom_t, leading to
the leaking of four bytes of uninitialized stack data to potentially
unprivileged callers.
v2 switches to memset() to avoid future issues if structure members
change, on suggestion of Dave Chinner.
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Reviewed-by: Eugene Teo <eugeneteo@kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r-- | fs/xfs/xfs_fsops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index ebc2f27ce9e1b0..34b435d9c5e8ee 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -72,6 +72,7 @@ xfs_fs_geometry( xfs_fsop_geom_t *geo, int new_version) { + memset(geo, 0, sizeof(*geo)); geo->blocksize = mp->m_sb.sb_blocksize; geo->rtextsize = mp->m_sb.sb_rextsize; geo->agblocks = mp->m_sb.sb_agblocks; |