android_kernel_oneplus_msm8998/fs/ext4
Hongjie Fang da612a5ae7 fscrypt: don't set policy for a dead directory
commit 5858bdad4d0d0fc18bf29f34c3ac836e0b59441f upstream.

The directory may have been removed when entering
fscrypt_ioctl_set_policy().  If so, the empty_dir() check will return
error for ext4 file system.

ext4_rmdir() sets i_size = 0, then ext4_empty_dir() reports an error
because 'inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2)'.  If
the fs is mounted with errors=panic, it will trigger a panic issue.

Add the check IS_DEADDIR() to fix this problem.

Fixes: 9bd8212f98 ("ext4 crypto: add encryption policy and password salt support")
Cc: <stable@vger.kernel.org> # v4.1+
Signed-off-by: Hongjie Fang <hongjiefang@asrmicro.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-21 09:07:10 +02:00
..
acl.c
acl.h
balloc.c ext4: check for allocation block validity with block group locked 2018-08-06 16:24:40 +02:00
bitmap.c
block_validity.c
crypto.c
crypto_fname.c
crypto_key.c
crypto_policy.c fscrypt: don't set policy for a dead directory 2019-07-21 09:07:10 +02:00
dir.c ext4: avoid divide by zero fault when deleting corrupted inline directories 2018-09-29 03:08:53 -07:00
ext4.h ext4: avoid running out of journal credits when appending to an inline file 2018-11-21 09:27:36 +01:00
ext4_crypto.h
ext4_extents.h ext4: verify the depth of extent tree in ext4_find_extent() 2018-07-11 16:03:48 +02:00
ext4_jbd2.c
ext4_jbd2.h ext4: fix NULL pointer dereference while journal is aborted 2019-04-03 06:23:15 +02:00
extents.c ext4: zero out the unused memory region in the extent tree block 2019-06-11 12:23:42 +02:00
extents_status.c
extents_status.h
file.c ext4: fix data corruption caused by unaligned direct AIO 2019-04-03 06:23:15 +02:00
fsync.c
hash.c
ialloc.c ext4: fix check to prevent initializing reserved inodes 2018-08-15 17:42:04 +02:00
indirect.c ext4: cleanup bh release code in ext4_ind_remove_space() 2019-04-27 09:33:47 +02:00
inline.c ext4: fix a potential fiemap/page fault deadlock w/ inline_data 2019-01-16 22:16:12 +01:00
inode.c ext4: do not delete unlinked inode from orphan list on failed truncate 2019-06-11 12:23:50 +02:00
ioctl.c ext4: actually request zeroing of inode table after grow 2019-06-11 12:23:38 +02:00
Kconfig
Makefile
mballoc.c ext4: fix spectre gadget in ext4_mb_regular_allocator() 2018-08-24 13:27:00 +02:00
mballoc.h
migrate.c
mmp.c ext4: don't mark mmp buffer head dirty 2018-09-29 03:08:54 -07:00
move_extent.c ext4: fix argument checking in EXT4_IOC_MOVE_EXT 2018-11-21 09:27:33 +01:00
namei.c ext4: fix buffer leak in __ext4_read_dirblock() on error path 2018-11-21 09:27:44 +01:00
page-io.c
readpage.c
resize.c ext4: report real fs size after failed resize 2019-04-27 09:33:56 +02:00
super.c ext4: fix ext4_show_options for file systems w/o journal 2019-06-11 12:23:38 +02:00
symlink.c
sysfs.c ext4: sysfs: print ext4_super_block fields as little-endian 2018-09-05 09:18:38 +02:00
truncate.h
xattr.c ext4: fix buffer leak in ext4_xattr_move_to_block() on error path 2018-11-21 09:27:43 +01:00
xattr.h ext4: fix deadlock between inline_data and ext4_expand_extra_isize_ea() 2018-04-24 09:32:10 +02:00
xattr_security.c
xattr_trusted.c
xattr_user.c