ext4: avoid writing unitialized memory to disk in EA inodes
authorJan Kara <jack@suse.cz>
Thu, 13 Jun 2024 15:02:34 +0000 (17:02 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 9 Jul 2024 03:59:37 +0000 (23:59 -0400)
commit65121eff3e4c8c90f8126debf3c369228691c591
tree59e70a576d62863e77bbd20bc814d40c87d785f2
parent7882b0187bbeb647967a7b5998ce4ad26ef68a9a
ext4: avoid writing unitialized memory to disk in EA inodes

If the extended attribute size is not a multiple of block size, the last
block in the EA inode will have uninitialized tail which will get
written to disk. We will never expose the data to userspace but still
this is not a good practice so just zero out the tail of the block as it
isn't going to cause a noticeable performance overhead.

Fixes: e50e5129f384 ("ext4: xattr-in-inode support")
Reported-by: syzbot+9c1fe13fcb51574b249b@syzkaller.appspotmail.com
Reported-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240613150234.25176-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/xattr.c