]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
selinux: prevent rentry into the FS
authorJosef Bacik <jbacik@redhat.com>
Thu, 3 Apr 2008 22:35:05 +0000 (09:35 +1100)
committerJames Morris <jmorris@namei.org>
Thu, 3 Apr 2008 22:35:05 +0000 (09:35 +1100)
BUG fix.  Keep us from re-entering the fs when we aren't supposed to.

See discussion at
http://marc.info/?t=120716967100004&r=1&w=2

Signed-off-by: Josef Bacik <jbacik@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/hooks.c

index c2fef7b12dc7de21bb32cb40d8dbc1032b256f38..820d07a60ab0f1bcd32f410637782ad24bb70531 100644 (file)
@@ -180,7 +180,7 @@ static int inode_alloc_security(struct inode *inode)
        struct task_security_struct *tsec = current->security;
        struct inode_security_struct *isec;
 
-       isec = kmem_cache_zalloc(sel_inode_cache, GFP_KERNEL);
+       isec = kmem_cache_zalloc(sel_inode_cache, GFP_NOFS);
        if (!isec)
                return -ENOMEM;
 
@@ -2429,7 +2429,7 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
                return -EOPNOTSUPP;
 
        if (name) {
-               namep = kstrdup(XATTR_SELINUX_SUFFIX, GFP_KERNEL);
+               namep = kstrdup(XATTR_SELINUX_SUFFIX, GFP_NOFS);
                if (!namep)
                        return -ENOMEM;
                *name = namep;