ext4: avoid clearing beyond i_blocks when truncating an inline data file
authorTheodore Ts'o <tytso@mit.edu>
Tue, 7 Jan 2014 17:58:19 +0000 (12:58 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Feb 2014 19:22:19 +0000 (11:22 -0800)
commit842408e7c7835d67c5eab0867fdd6b4676dc11bd
tree10fbc597cc7f94151003de38940e8677cffa8f78
parent9ac25d5623b1ead9d3cd0981c668e97d26b2bef2
ext4: avoid clearing beyond i_blocks when truncating an inline data file

commit 09c455aaa8f47a94d5bafaa23d58365768210507 upstream.

A missing cast means that when we are truncating a file which is less
than 60 bytes, we don't clear the correct area of memory, and in fact
we can end up truncating the next inode in the inode table, or worse
yet, some other kernel data structure.

Addresses-Coverity-Id: #751987

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inline.c