[PATCH] catch acl==NULL in __jfs_set_acl (fixed null pointer dereference)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



__jfs_set_acl() does not check for acl being NULL

In my case, the kernel null pointer dereference occurs when exporting jfs over nfs3. Accessing the nfs causes a crash of the nfsd and corrupted files, probably as a clean
unmount is not possible.


--- linux-3.14.2_vanilla/fs/jfs/acl.c	2014-04-28 17:24:55.544597204 +0200
+++ linux-3.14.2_patched/fs/jfs/acl.c	2014-04-29 19:44:13.589311607 +0200
@@ -83,13 +83,15 @@
 	switch (type) {
 	case ACL_TYPE_ACCESS:
 		ea_name = POSIX_ACL_XATTR_ACCESS;
-		rc = posix_acl_equiv_mode(acl, &inode->i_mode);
-		if (rc < 0)
-			return rc;
-		inode->i_ctime = CURRENT_TIME;
-		mark_inode_dirty(inode);
-		if (rc == 0)
-			acl = NULL;
+		if( acl ) {
+			rc = posix_acl_equiv_mode(acl, &inode->i_mode);
+			if (rc < 0)
+				return rc;
+			inode->i_ctime = CURRENT_TIME;
+			mark_inode_dirty(inode);
+			if (rc == 0)
+				acl = NULL;
+		}
 		break;
 	case ACL_TYPE_DEFAULT:
 		ea_name = POSIX_ACL_XATTR_DEFAULT;

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux