]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ext4: include terminating u32 in size of xattr entries when expanding inodes
authorTheodore Ts'o <tytso@mit.edu>
Wed, 19 Dec 2018 17:28:13 +0000 (12:28 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit840d92547cec5aa0c27cb71cc635f5e33b6783f8
treec46768d2c587780ec2cfe132ef3a89dbb6a33a6d
parent9a060855d23c09681351489efa99bddb94ed758a
ext4: include terminating u32 in size of xattr entries when expanding inodes

BugLink: https://bugs.launchpad.net/bugs/1837257
commit a805622a757b6d7f65def4141d29317d8e37b8a1 upstream.

In ext4_expand_extra_isize_ea(), we calculate the total size of the
xattr header, plus the xattr entries so we know how much of the
beginning part of the xattrs to move when expanding the inode extra
size.  We need to include the terminating u32 at the end of the xattr
entries, or else if there is uninitialized, non-zero bytes after the
xattr entries and before the xattr values, the list of xattr entries
won't be properly terminated.

Reported-by: Steve Graham <stgraham2000@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/ext4/xattr.c