ext4: add sanity checking to count_overhead()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 18 Nov 2016 18:37:47 +0000 (13:37 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:27 +0000 (02:18 +0000)
commitcbcef10ae6060412e8f2cad26ed9468bc472733a
tree02c986fb9f3692c207ac9b950372b261e0444196
parent14f48cfd0bac66d471104d739595fc3c6d0ffc78
ext4: add sanity checking to count_overhead()

commit c48ae41bafe31e9a66d8be2ced4e42a6b57fa814 upstream.

The commit "ext4: sanity check the block and cluster size at mount
time" should prevent any problems, but in case the superblock is
modified while the file system is mounted, add an extra safety check
to make sure we won't overrun the allocated buffer.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/super.c