summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2010-03-23 13:35:38 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-13 13:20:20 -0700
commitbd91f592633c1a3ec88ac2dd55b81cde45955b1d (patch)
tree4641a70129e3f312f4491d36fcd61d591530a6ab /fs
parentee0f79ddf59966d514dae5b6c9fcfca0aec46492 (diff)
reiserfs: fix oops while creating privroot with selinux enabled
commit 6cb4aff0a77cc0e6bae9475d62205319e3ebbf3f upstream. Commit 57fe60df ("reiserfs: add atomic addition of selinux attributes during inode creation") contains a bug that will cause it to oops when mounting a file system that didn't previously contain extended attributes on a system using security.* xattrs. The issue is that while creating the privroot during mount reiserfs_security_init calls reiserfs_xattr_jcreate_nblocks which dereferences the xattr root. The xattr root doesn't exist, so we get an oops. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=15309 Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/reiserfs/xattr_security.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c
index a92c8792c0f6..b37b13b93d89 100644
--- a/fs/reiserfs/xattr_security.c
+++ b/fs/reiserfs/xattr_security.c
@@ -75,7 +75,7 @@ int reiserfs_security_init(struct inode *dir, struct inode *inode,
return error;
}
- if (sec->length) {
+ if (sec->length && reiserfs_xattrs_initialized(inode->i_sb)) {
blocks = reiserfs_xattr_jcreate_nblocks(inode) +
reiserfs_xattr_nblocks(inode, sec->length);
/* We don't want to count the directories twice if we have