Skip to content

Commit 5553c25

Browse files
Fix gate replacement for non-EPT backends.
1 parent 9970ccc commit 5553c25

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

kraft/app/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,18 +837,22 @@ def simple_replace(template_path, path, marker, shstack_enabled=True):
837837
add_local_linkerscript(lib, fulldiff=fulldiff)
838838

839839
# then generate cocci files dynamically from the template
840-
gr_rule_template = get_sec_rule("gatereplacer.cocci.in")
840+
if is_ept:
841+
gr_rule_template = get_sec_rule("gatereplacer_ept.cocci.in")
842+
else:
843+
gr_rule_template = get_sec_rule("gatereplacer.cocci.in")
841844
if FCALLS_enabled:
842845
cb_rule_template = get_sec_rule("rmcallbacks.cocci.in")
843846
else:
844847
cb_rule_template = get_sec_rule("callbackreplacer.cocci.in")
848+
845849
gr_rule_template = gr_rule_template.replace("{{ comp_cur_nb }}",
846850
str(lib.compartment.number))
851+
ept_rpc_id_prefix = "_RPC_ID_" if is_ept else ""
847852
cb_rule_template = cb_rule_template.replace("{{ comp_cur_nb }}",
848853
str(lib.compartment.number))
849854
gr_rule = ""
850855

851-
ept_rpc_id_prefix = "_RPC_ID_" if is_ept else ""
852856
if (is_ept):
853857
rpc_id_gen_template = get_sec_rule("rpc_id_gen.cocci.in")
854858
rpc_id_gen_template = rpc_id_gen_template.replace("{{ filename }}",

0 commit comments

Comments
 (0)