SELinux: more GFP_NOFS fixups to prevent selinux from re-entering the fs code
More cases where SELinux must not re-enter the fs code. Called from the d_instantiate security hook. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:

committed by
James Morris

parent
ff09e2afe7
commit
869ab5147e
@@ -1143,7 +1143,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
|
||||
}
|
||||
|
||||
len = INITCONTEXTLEN;
|
||||
context = kmalloc(len, GFP_KERNEL);
|
||||
context = kmalloc(len, GFP_NOFS);
|
||||
if (!context) {
|
||||
rc = -ENOMEM;
|
||||
dput(dentry);
|
||||
@@ -1161,7 +1161,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
|
||||
}
|
||||
kfree(context);
|
||||
len = rc;
|
||||
context = kmalloc(len, GFP_KERNEL);
|
||||
context = kmalloc(len, GFP_NOFS);
|
||||
if (!context) {
|
||||
rc = -ENOMEM;
|
||||
dput(dentry);
|
||||
@@ -1185,7 +1185,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
|
||||
rc = 0;
|
||||
} else {
|
||||
rc = security_context_to_sid_default(context, rc, &sid,
|
||||
sbsec->def_sid);
|
||||
sbsec->def_sid,
|
||||
GFP_NOFS);
|
||||
if (rc) {
|
||||
printk(KERN_WARNING "%s: context_to_sid(%s) "
|
||||
"returned %d for dev=%s ino=%ld\n",
|
||||
|
Reference in New Issue
Block a user