]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
ext4: fix xattr shifting when expanding inodes part 2
authorJan Kara <jack@suse.cz>
Thu, 11 Aug 2016 15:58:32 +0000 (11:58 -0400)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:11:38 +0000 (15:41 +0530)
commitb83a216cd1ab493de29082789fdfaba084f9697d
tree0a57457a7b98162d7cc2e6811ede9eb3cce3a183
parentae59122338fc74b30b4925927dba67c54f2b78c7
ext4: fix xattr shifting when expanding inodes part 2

commit 418c12d08dc64a45107c467ec1ba29b5e69b0715 upstream.

When multiple xattrs need to be moved out of inode, we did not properly
recompute total size of xattr headers in the inode and the new header
position. Thus when moving the second and further xattr we asked
ext4_xattr_shift_entries() to move too much and from the wrong place,
resulting in possible xattr value corruption or general memory
corruption.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c