From 5553c25eac9e64bcc7cff58719e9af1fdd3a73c8 Mon Sep 17 00:00:00 2001 From: Sebastian Rauch Date: Tue, 21 Dec 2021 13:22:51 +0100 Subject: [PATCH] Fix gate replacement for non-EPT backends. --- kraft/app/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kraft/app/app.py b/kraft/app/app.py index 83e4e3fb..75d56697 100644 --- a/kraft/app/app.py +++ b/kraft/app/app.py @@ -837,18 +837,22 @@ def simple_replace(template_path, path, marker, shstack_enabled=True): add_local_linkerscript(lib, fulldiff=fulldiff) # then generate cocci files dynamically from the template - gr_rule_template = get_sec_rule("gatereplacer.cocci.in") + if is_ept: + gr_rule_template = get_sec_rule("gatereplacer_ept.cocci.in") + else: + gr_rule_template = get_sec_rule("gatereplacer.cocci.in") if FCALLS_enabled: cb_rule_template = get_sec_rule("rmcallbacks.cocci.in") else: cb_rule_template = get_sec_rule("callbackreplacer.cocci.in") + gr_rule_template = gr_rule_template.replace("{{ comp_cur_nb }}", str(lib.compartment.number)) + ept_rpc_id_prefix = "_RPC_ID_" if is_ept else "" cb_rule_template = cb_rule_template.replace("{{ comp_cur_nb }}", str(lib.compartment.number)) gr_rule = "" - ept_rpc_id_prefix = "_RPC_ID_" if is_ept else "" if (is_ept): rpc_id_gen_template = get_sec_rule("rpc_id_gen.cocci.in") rpc_id_gen_template = rpc_id_gen_template.replace("{{ filename }}",