diff --git a/kraft/app/app.py b/kraft/app/app.py index 139d62f6..cb5df0a9 100644 --- a/kraft/app/app.py +++ b/kraft/app/app.py @@ -800,7 +800,10 @@ def simple_replace(template_path, path, marker, shstack_enabled=True): # then generate cocci files dynamically from the template gr_rule_template = get_sec_rule("gatereplacer.cocci.in") - cb_rule_template = get_sec_rule("callbackreplacer.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)) cb_rule_template = cb_rule_template.replace("{{ comp_cur_nb }}", diff --git a/kraft/sec/rules/rmcallbacks.cocci.in b/kraft/sec/rules/rmcallbacks.cocci.in new file mode 100644 index 00000000..6c67bd6b --- /dev/null +++ b/kraft/sec/rules/rmcallbacks.cocci.in @@ -0,0 +1,9 @@ +@cbvoid{{ rule_nr }}@ +identifier func; +type T; +@@ + +- __attribute__(({{ lib_from_name }}_callback)) +T func(...) { +... +}