Commit 2b86e04b authored by Christian Göttsche's avatar Christian Göttsche Committed by Paul Moore

selinux: use GFP_KERNEL while reading binary policy

Use GFP_KERNEL instead of GFP_ATOMIC while reading a binary policy in
sens_read() and cat_read(), similar to surrounding code.
Signed-off-by: default avatarChristian Göttsche <cgzones@googlemail.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 64f18f8a
...@@ -1597,7 +1597,7 @@ static int sens_read(struct policydb *p, struct symtab *s, void *fp) ...@@ -1597,7 +1597,7 @@ static int sens_read(struct policydb *p, struct symtab *s, void *fp)
__le32 buf[2]; __le32 buf[2];
u32 len; u32 len;
levdatum = kzalloc(sizeof(*levdatum), GFP_ATOMIC); levdatum = kzalloc(sizeof(*levdatum), GFP_KERNEL);
if (!levdatum) if (!levdatum)
return -ENOMEM; return -ENOMEM;
...@@ -1608,12 +1608,12 @@ static int sens_read(struct policydb *p, struct symtab *s, void *fp) ...@@ -1608,12 +1608,12 @@ static int sens_read(struct policydb *p, struct symtab *s, void *fp)
len = le32_to_cpu(buf[0]); len = le32_to_cpu(buf[0]);
levdatum->isalias = le32_to_cpu(buf[1]); levdatum->isalias = le32_to_cpu(buf[1]);
rc = str_read(&key, GFP_ATOMIC, fp, len); rc = str_read(&key, GFP_KERNEL, fp, len);
if (rc) if (rc)
goto bad; goto bad;
rc = -ENOMEM; rc = -ENOMEM;
levdatum->level = kmalloc(sizeof(*levdatum->level), GFP_ATOMIC); levdatum->level = kmalloc(sizeof(*levdatum->level), GFP_KERNEL);
if (!levdatum->level) if (!levdatum->level)
goto bad; goto bad;
...@@ -1638,7 +1638,7 @@ static int cat_read(struct policydb *p, struct symtab *s, void *fp) ...@@ -1638,7 +1638,7 @@ static int cat_read(struct policydb *p, struct symtab *s, void *fp)
__le32 buf[3]; __le32 buf[3];
u32 len; u32 len;
catdatum = kzalloc(sizeof(*catdatum), GFP_ATOMIC); catdatum = kzalloc(sizeof(*catdatum), GFP_KERNEL);
if (!catdatum) if (!catdatum)
return -ENOMEM; return -ENOMEM;
...@@ -1650,7 +1650,7 @@ static int cat_read(struct policydb *p, struct symtab *s, void *fp) ...@@ -1650,7 +1650,7 @@ static int cat_read(struct policydb *p, struct symtab *s, void *fp)
catdatum->value = le32_to_cpu(buf[1]); catdatum->value = le32_to_cpu(buf[1]);
catdatum->isalias = le32_to_cpu(buf[2]); catdatum->isalias = le32_to_cpu(buf[2]);
rc = str_read(&key, GFP_ATOMIC, fp, len); rc = str_read(&key, GFP_KERNEL, fp, len);
if (rc) if (rc)
goto bad; goto bad;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment