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.



 security/selinux/ss/services.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN security/selinux/ss/services.c~selinux-convert_context-fix security/selinux/ss/services.c
--- 25/security/selinux/ss/services.c~selinux-convert_context-fix	2003-09-24 12:09:15.000000000 -0700
+++ 25-akpm/security/selinux/ss/services.c	2003-09-24 12:09:15.000000000 -0700
@@ -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]);

_