@@ -26,7 +26,7 @@
#define _copy_from_guest copy_from_guest
enum flask_bootparam_t __read_mostly flask_bootparam = FLASK_BOOTPARAM_ENFORCING;
-static void parse_flask_param(char *s);
+static int parse_flask_param(char *s);
custom_param("flask", parse_flask_param);
bool_t __read_mostly flask_enforcing = 1;
@@ -58,7 +58,7 @@ static int flask_security_make_bools(void);
extern int ss_initialized;
-static void __init parse_flask_param(char *s)
+static int __init parse_flask_param(char *s)
{
if ( !strcmp(s, "enforcing") )
flask_bootparam = FLASK_BOOTPARAM_ENFORCING;
@@ -70,6 +70,8 @@ static void __init parse_flask_param(char *s)
flask_bootparam = FLASK_BOOTPARAM_PERMISSIVE;
else
flask_bootparam = FLASK_BOOTPARAM_INVALID;
+
+ return (flask_bootparam == FLASK_BOOTPARAM_INVALID) ? -EINVAL : 0;
}
static int domain_has_security(struct domain *d, u32 perms)
Modify the custom parameter parsing routines in: xen/xsm/flask/flask_op.c to indicate whether the parameter value was parsed successfully. Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Juergen Gross <jgross@suse.com> --- xen/xsm/flask/flask_op.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)