A maliciously corrupted file systems can trigger buffer overruns in
the quota code used by fsck.
To fix it, quota file sizes are checked against real allocated
block index tables (inode, direct nodes, indirect nodes, double
indirect nodes). If the size mismatches, the quota file is considered
corrupted and will be regenerated.
Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Propagate correct error number from write_dquots() to
quota_write_inode().
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
We have to keep data for roll-forward recovery. Without this patch, we're
able to lose there-in data by quota overwrites.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
If it detects quota file errors, we can see insane quota limits. In order
to recover that, this patch adds an option to reset them as zeros.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This patch let fsck to check and fix quota file contents.
Signed-off-by: Hyojun Kim <hyojun@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>