From 4dfbe983b14062c6299b865d1535b2a478c14378 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 1 Oct 2003 10:58:39 -0700 Subject: [PATCH] [PATCH] Fix bug in SELinux convert_context From: Stephen Smalley 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. --- security/selinux/ss/services.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 6bc590095186e..984c75bbf127e 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -896,7 +896,7 @@ static int convert_context(u32 key, struct user_datum *usrdatum; char *s; u32 len; - int rc = -EINVAL; + int rc; args = p; @@ -904,6 +904,8 @@ static int convert_context(u32 key, if (rc) goto out; + rc = -EINVAL; + /* Convert the user. */ usrdatum = hashtab_search(args->newp->p_users.table, args->oldp->p_user_val_to_name[c->user - 1]); -- 2.53.0