android_kernel_samsung_a7y1.../fs/ext4
Hongjie Fang 1f7f794f23 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: 9bd8212f981e ("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>
2020-04-06 19:29:02 +02:00
..
sdp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
acl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
acl.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
balloc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bitmap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
block_validity.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto_fname.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto_key.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto_policy.c fscrypt: don't set policy for a dead directory 2020-04-06 19:29:02 +02:00
crypto.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dir.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ext4_crypto.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ext4_extents.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ext4_jbd2.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ext4_jbd2.h ext4: fix NULL pointer dereference while journal is aborted 2020-04-06 10:58:15 +02:00
ext4.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extents_status.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extents_status.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extents.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file.c ext4: fix data corruption caused by unaligned direct AIO 2020-04-06 10:58:16 +02:00
fscrypt_knox_private.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fsync.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hash.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ialloc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
indirect.c ext4: cleanup bh release code in ext4_ind_remove_space() 2020-04-06 13:43:42 +02:00
inline.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode.c ext4: do not delete unlinked inode from orphan list on failed truncate 2020-04-06 18:14:53 +02:00
ioctl.c ext4: actually request zeroing of inode table after grow 2020-04-06 18:12:36 +02:00
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mballoc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mballoc.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
migrate.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mmp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
move_extent.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
namei.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
page-io.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
readpage.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
resize.c ext4: report real fs size after failed resize 2020-04-06 15:16:53 +02:00
super.c ext4: fix ext4_show_options for file systems w/o journal 2020-04-06 18:12:38 +02:00
symlink.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
truncate.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr_security.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr_trusted.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr_user.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30