summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-12-10 23:44:11 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-20 10:10:22 +0100
commit0228af23dd6962c16682d85fdf1bab6bbf77a007 (patch)
treea04b5740856a0b1f1ee42bfc10fdfbdb798306ad /fs
parent4ff7da066d64e5083ef886203ba3a0623343c632 (diff)
downloadlinux-stable-0228af23dd6962c16682d85fdf1bab6bbf77a007.tar.gz
linux-stable-0228af23dd6962c16682d85fdf1bab6bbf77a007.tar.bz2
linux-stable-0228af23dd6962c16682d85fdf1bab6bbf77a007.zip
ext4: add missing error check in __ext4_new_inode()
commit 996fc4477a0ea28226b30d175f053fb6f9a4fa36 upstream. It's possible for ext4_get_acl() to return an ERR_PTR. So we need to add a check for this case in __ext4_new_inode(). Otherwise on an error we can end up oops the kernel. This was getting triggered by xfstests generic/388, which is a test which exercises the shutdown code path. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ialloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index c5f697a3fad4..207588dc803e 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -816,6 +816,8 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
#ifdef CONFIG_EXT4_FS_POSIX_ACL
struct posix_acl *p = get_acl(dir, ACL_TYPE_DEFAULT);
+ if (IS_ERR(p))
+ return ERR_CAST(p);
if (p) {
int acl_size = p->a_count * sizeof(ext4_acl_entry);