Commit 4dfbe983 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix bug in SELinux convert_context

From: Stephen Smalley <sds@epoch.ncsc.mil>

This patch fixes a bug introduced by earlier code cleanups in the SELinux
convert_context code that manifests upon a policy reload that removes
previously valid security attributes.  Thanks to Magosanyi Arpad for
reporting the bug.
parent ff2de3b3
...@@ -896,7 +896,7 @@ static int convert_context(u32 key, ...@@ -896,7 +896,7 @@ static int convert_context(u32 key,
struct user_datum *usrdatum; struct user_datum *usrdatum;
char *s; char *s;
u32 len; u32 len;
int rc = -EINVAL; int rc;
args = p; args = p;
...@@ -904,6 +904,8 @@ static int convert_context(u32 key, ...@@ -904,6 +904,8 @@ static int convert_context(u32 key,
if (rc) if (rc)
goto out; goto out;
rc = -EINVAL;
/* Convert the user. */ /* Convert the user. */
usrdatum = hashtab_search(args->newp->p_users.table, usrdatum = hashtab_search(args->newp->p_users.table,
args->oldp->p_user_val_to_name[c->user - 1]); args->oldp->p_user_val_to_name[c->user - 1]);
......
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