/* Set the MLS fields in the security context structure  */
int mls_from_string(char *str, struct context *context, gfp_t gfp_mask)
/* Set the MLS fields in the security context structure  */
int mls_from_string(char *str, struct context *context, gfp_t gfp_mask)
{
	char *tmpstr, *freestr;
	int rc;
	if (!selinux_mls_enabled)
		return -EINVAL;
	tmpstr = freestr = kstrdup(str, gfp_mask);
	if (!tmpstr) {
		rc = -ENOMEM;
	} else {
		rc = mls_context_to_sid(&policydb, ':', &tmpstr, context,
					NULL, SECSID_NULL);
		kfree(freestr);
	}
	return rc;
}