diff options
author | Eric Biggers <ebiggers@google.com> | 2016-12-01 14:43:33 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-12-01 14:43:33 -0500 |
commit | 2dc8d9e19b0d891b0d3675b5ac82be9be3875e36 (patch) | |
tree | 04d4cf3d3be395178b1d5553e2191d8b4c5da1eb /scripts/gcc-plugins/gcc-generate-rtl-pass.h | |
parent | ba679017ef0f47d31c50df731441fdd39bf4bf13 (diff) |
ext4: forbid i_extra_isize not divisible by 4
i_extra_isize not divisible by 4 is problematic for several reasons:
- It causes the in-inode xattr space to be misaligned, but the xattr
header and entries are not declared __packed to express this
possibility. This may cause poor performance or incorrect code
generation on some platforms.
- When validating the xattr entries we can read past the end of the
inode if the size available for xattrs is not a multiple of 4.
- It allows the nonsensical i_extra_isize=1, which doesn't even leave
enough room for i_extra_isize itself.
Therefore, update ext4_iget() to consider i_extra_isize not divisible by
4 to be an error, like the case where i_extra_isize is too large.
This also matches the rule recently added to e2fsck for determining
whether an inode has valid i_extra_isize.
This patch shouldn't have any noticeable effect on
non-corrupted/non-malicious filesystems, since the size of ext4_inode
has always been a multiple of 4.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Diffstat (limited to 'scripts/gcc-plugins/gcc-generate-rtl-pass.h')
0 files changed, 0 insertions, 0 deletions