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
Signed-off-by: Juergen Gross
Acked-by: Daniel De Graaf
Acked-by: Wei Liu
---
xen/xsm/flask/flask_op.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index 719c2d7efc..35598b5fd8 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -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)
--
2.12.3
___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel