[PATCH] reiserfs: fix potential (unlikely) oops in reiserfs_get_acl

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

 



 This patch fixes a potential oops if there is an error reported by
 posix_acl_from_disk(). This is mostly theoretical due to the use of 
 magics and checksums in xattrs, but is still possible.

 fs/reiserfs/xattr_acl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Signed-off-by: Jeff Mahoney <[email protected]>

diff -ruNpX ../dontdiff linux-2.6.15-staging1/fs/reiserfs/xattr_acl.c linux-2.6.15-staging2/fs/reiserfs/xattr_acl.c
--- linux-2.6.15-staging1/fs/reiserfs/xattr_acl.c	2006-02-10 16:27:18.000000000 -0500
+++ linux-2.6.15-staging2/fs/reiserfs/xattr_acl.c	2006-02-10 16:40:56.000000000 -0500
@@ -228,7 +228,8 @@ struct posix_acl *reiserfs_get_acl(struc
 		acl = ERR_PTR(retval);
 	} else {
 		acl = posix_acl_from_disk(value, retval);
-		*p_acl = posix_acl_dup(acl);
+		if (!IS_ERR(acl))
+			*p_acl = posix_acl_dup(acl);
 	}
 
 	kfree(value);
-- 
Jeff Mahoney
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux