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>
Sun, 22 May 2016 00:31:59 +0000 (20:31 -0400)
commit4bfb35e1e6489ccf92144d9977e4d0f8f14ac3b4
tree41fa5b7ead4a9c9a02e3741ceef72497ecf6d219
parent3a50a3eaf2ade0f3cc60fea6260d3c588464d503
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