diff options
author | William Burrow <wbkernel@gmail.com> | 2014-05-28 22:05:55 -0400 |
---|---|---|
committer | Dave Kleikamp <dave.kleikamp@oracle.com> | 2014-05-28 22:19:02 -0400 |
commit | e31da3f98d3b8626b32cf7806ef4da540bf70820 (patch) | |
tree | bd183efdd97319715b1054b03341f92cb61173c2 /fs/jfs | |
parent | 24e4a0f3de21ad715c9235367e241554c64b9adb (diff) |
JFS: Check for NULL before calling posix_acl_equiv_mode()
Check for NULL before using the acl in the access type switch
statement. This seems to be consistent with what is done in the JFFS
and ext4 filesystems and with the behaviour of JFS in the 3.13 kernel.
The bug seemed to be introduced in commit 2cc6a5a0.
The bug results in a kernel Oops, NULL dereference could not be handled
when accessing a JFS filesystem. The rdiff-backup process seemed to
trigger the bug. See also reported bug #75341:
https://bugzilla.kernel.org/show_bug.cgi?id=75341
Signed-off-by: William Burrow <wbkernel@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Diffstat (limited to 'fs/jfs')
-rw-r--r-- | fs/jfs/acl.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index 5a8ea16eedbc..0c8ca830b113 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c | |||
@@ -83,13 +83,15 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type, | |||
83 | switch (type) { | 83 | switch (type) { |
84 | case ACL_TYPE_ACCESS: | 84 | case ACL_TYPE_ACCESS: |
85 | ea_name = POSIX_ACL_XATTR_ACCESS; | 85 | ea_name = POSIX_ACL_XATTR_ACCESS; |
86 | rc = posix_acl_equiv_mode(acl, &inode->i_mode); | 86 | if (acl) { |
87 | if (rc < 0) | 87 | rc = posix_acl_equiv_mode(acl, &inode->i_mode); |
88 | return rc; | 88 | if (rc < 0) |
89 | inode->i_ctime = CURRENT_TIME; | 89 | return rc; |
90 | mark_inode_dirty(inode); | 90 | inode->i_ctime = CURRENT_TIME; |
91 | if (rc == 0) | 91 | mark_inode_dirty(inode); |
92 | acl = NULL; | 92 | if (rc == 0) |
93 | acl = NULL; | ||
94 | } | ||
93 | break; | 95 | break; |
94 | case ACL_TYPE_DEFAULT: | 96 | case ACL_TYPE_DEFAULT: |
95 | ea_name = POSIX_ACL_XATTR_DEFAULT; | 97 | ea_name = POSIX_ACL_XATTR_DEFAULT; |