Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e31da3f9 authored by William Burrow's avatar William Burrow Committed by Dave Kleikamp
Browse files

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: default avatarWilliam Burrow <wbkernel@gmail.com>
Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
parent 24e4a0f3
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
	switch (type) {
	case ACL_TYPE_ACCESS:
		ea_name = POSIX_ACL_XATTR_ACCESS;
		if (acl) {
			rc = posix_acl_equiv_mode(acl, &inode->i_mode);
			if (rc < 0)
				return rc;
@@ -90,6 +91,7 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
			mark_inode_dirty(inode);
			if (rc == 0)
				acl = NULL;
		}
		break;
	case ACL_TYPE_DEFAULT:
		ea_name = POSIX_ACL_XATTR_DEFAULT;