From: Frantisek Sumsal Date: Mon, 30 Oct 2023 16:50:11 +0000 (+0100) Subject: core: check if we got a valid personality during deserialization X-Git-Tag: v255-rc1~79^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f93eb159a708b7161188ae4c75be388cdfedabc;p=thirdparty%2Fsystemd.git core: check if we got a valid personality during deserialization --- diff --git a/src/core/execute-serialize.c b/src/core/execute-serialize.c index 18033fe9c30..342883994a8 100644 --- a/src/core/execute-serialize.c +++ b/src/core/execute-serialize.c @@ -3395,9 +3395,11 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) { r = free_and_strdup(&c->smack_process_label, val); if (r < 0) return r; - } else if ((val = startswith(l, "exec-context-personality="))) + } else if ((val = startswith(l, "exec-context-personality="))) { c->personality = personality_from_string(val); - else if ((val = startswith(l, "exec-context-lock-personality="))) { + if (c->personality == PERSONALITY_INVALID) + return -EINVAL; + } else if ((val = startswith(l, "exec-context-lock-personality="))) { r = parse_boolean(val); if (r < 0) return r;