Whamcloud - gitweb
mke2fs: fix project quota creation
authorTheodore Ts'o <tytso@mit.edu>
Sun, 22 May 2016 00:31:59 +0000 (20:31 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 24 May 2016 17:37:45 +0000 (13:37 -0400)
commit64f5a8f084199d070969c2cfca592995034cf21e
treee964e5d790b254a1bebf97379d1217d7ea28bced
parente31b4e03ee1e036ba9dd65b43f244356ddbc69a8
mke2fs: fix project quota creation

Creating a file system with project quotas can fail if mke2fs is built
using hardening options.  This is because quota_compute_usage() used
ext2fs_get_next_inode() instead of ext2fs_get_inode_full(), and a
small inode was passed into quota_data_add, when a large inode needs
to be used.  As a result get_dq() would end up dereferencing undefined
space in the stack.  Without the hardening options, this would be
zero, so "mke2fs -t ext4 -O project.quota -I 256 test.img" would work
essentially by accident.

Fix this by using ext2fs_get_inode_full() so that a large inode is
available to quota_data_inodes().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/support/mkquota.c