android_kernel_samsung_a7y1.../fs
zhangyi (F) 89947a0489 ext4: brelse all indirect buffer in ext4_ind_remove_space()
commit 674a2b27234d1b7afcb0a9162e81b2e53aeef217 upstream.

All indirect buffers get by ext4_find_shared() should be released no
mater the branch should be freed or not. But now, we forget to release
the lower depth indirect buffers when removing space from the same
higher depth indirect block. It will lead to buffer leak and futher
more, it may lead to quota information corruption when using old quota,
consider the following case.

 - Create and mount an empty ext4 filesystem without extent and quota
   features,
 - quotacheck and enable the user & group quota,
 - Create some files and write some data to them, and then punch hole
   to some files of them, it may trigger the buffer leak problem
   mentioned above.
 - Disable quota and run quotacheck again, it will create two new
   aquota files and write the checked quota information to them, which
   probably may reuse the freed indirect block(the buffer and page
   cache was not freed) as data block.
 - Enable quota again, it will invoke
   vfs_load_quota_inode()->invalidate_bdev() to try to clean unused
   buffers and pagecache. Unfortunately, because of the buffer of quota
   data block is still referenced, quota code cannot read the up to date
   quota info from the device and lead to quota information corruption.

This problem can be reproduced by xfstests generic/231 on ext3 file
system or ext4 file system without extent and quota features.

This patch fix this problem by releasing the missing indirect buffers,
in ext4_ind_remove_space().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 10:58:17 +02:00
..
9p A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
adfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
affs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
afs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
autofs4 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
befs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
btrfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cachefiles A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ceph A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cifs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
coda A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
configfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cramfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debugfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
devpts A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecryptfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
efivarfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
efs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
exofs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
exportfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ext2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ext4 ext4: brelse all indirect buffer in ext4_ind_remove_space() 2020-04-06 10:58:17 +02:00
f2fs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fat A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
freevxfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fscache A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fuse A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gfs2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hfsplus A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hostfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hpfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hugetlbfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
isofs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
jbd2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
jffs2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
jfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kernfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lockd A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
logfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
minix A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ncpfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nfs_common A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nfsd A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nilfs2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nls A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
notify A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ntfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ocfs2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
omfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
openpromfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
overlayfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pstore A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
qnx4 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
qnx6 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
quota A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ramfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
reiserfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
romfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sdcardfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sdfat A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
squashfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysv A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tracefs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ubifs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udf udf: Fix crash on IO error during truncate 2020-04-06 10:58:12 +02:00
ufs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
aio.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
anon_inodes.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
attr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bad_inode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
binfmt_aout.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
binfmt_elf_fdpic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
binfmt_elf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
binfmt_em86.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
binfmt_flat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
binfmt_misc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
binfmt_script.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
block_dev.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
buffer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
char_dev.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compat_binfmt_elf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compat_ioctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
coredump.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dax.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dcache.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dcookies.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
direct-io.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlog_hook.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
drop_caches.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
eventfd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
eventpoll.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
exec.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fcntl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fhandle.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file_table.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
filesystems.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fs_pin.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fs_struct.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fs-writeback.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ioctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.binfmt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
libfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locks.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mbcache.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mount.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mpage.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
namei.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
namespace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
no-block.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nsfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
open.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pipe.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pnode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pnode.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
posix_acl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc_namespace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
read_write.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
readdir.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
select.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
seq_file.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
signalfd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
splice.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stack.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
statfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
super.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sync.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
timerfd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
userfaultfd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
utimes.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30