quota: info leak in quota_getquota()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 1 Nov 2013 10:21:54 +0000 (13:21 +0300)
committerJan Kara <jack@suse.cz>
Mon, 4 Nov 2013 13:16:55 +0000 (14:16 +0100)
The if_dqblk struct has a 4 byte hole at the end of the struct so
uninitialized stack information is leaked to user space.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/quota.c

index dea86e8..2b363e2 100644 (file)
@@ -117,6 +117,7 @@ static int quota_setinfo(struct super_block *sb, int type, void __user *addr)
 
 static void copy_to_if_dqblk(struct if_dqblk *dst, struct fs_disk_quota *src)
 {
+       memset(dst, 0, sizeof(*dst));
        dst->dqb_bhardlimit = src->d_blk_hardlimit;
        dst->dqb_bsoftlimit = src->d_blk_softlimit;
        dst->dqb_curspace = src->d_bcount;