]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ext4: clear i_data in ext4_inode_info when removing inline data
authorTheodore Ts'o <tytso@mit.edu>
Tue, 24 Jul 2018 16:38:03 +0000 (18:38 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:30:22 +0000 (12:30 +0200)
commit94571f2627d5632f2c6d94fcabf69150f45a5304
tree39024078ff40406cd7f4b8a9aeb597fe3fad7642
parentbaa4f96ad566ede913213f73364ed4be7a128db3
ext4: clear i_data in ext4_inode_info when removing inline data

CVE-2018-10881

When converting from an inode from storing the data in-line to a data
block, ext4_destroy_inline_data_nolock() was only clearing the on-disk
copy of the i_blocks[] array.  It was not clearing copy of the
i_blocks[] in ext4_inode_info, in i_data[], which is the copy actually
used by ext4_map_blocks().

This didn't matter much if we are using extents, since the extents
header would be invalid and thus the extents could would re-initialize
the extents tree.  But if we are using indirect blocks, the previous
contents of the i_blocks array will be treated as block numbers, with
potentially catastrophic results to the file system integrity and/or
user data.

This gets worse if the file system is using a 1k block size and
s_first_data is zero, but even without this, the file system can get
quite badly corrupted.

This addresses CVE-2018-10881.

https://bugzilla.kernel.org/show_bug.cgi?id=200015

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
(cherry picked from commit 6e8ab72a812396996035a37e5ca4b3b99b5d214b)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/ext4/inline.c