sanitizer

fun sanitizer(symbol: String)

Declare a sanitizer function. PhASAR treats the function's return value as clean regardless of input taint — emitted into the cfg as {"name": "<symbol>", "ret": "sanitizer"}.

Use this for domain validators that produce a verdict whose value is intrinsic to the ASIL rating (e.g. CheckInputValidity(fan, is_timestamp_valid) → ContainerQualifier). The validator may use QM-tainted inputs to decide what to return, but the returned value is by design clean (its possible values are fixed enum constants, not derived QM data).

IMPORTANT: PhASAR matches by exact LLVM symbol. For:

  • extern "C" int fn(...) → pass "fn".

  • C++ with namespace/class → pass the mangled Itanium-ABI name (e.g. "_ZN3app19IsContainerQualifierOkENS_6common18ContainerQualifierE"), which you can obtain from llvm-nm on the activity bitcode.

The function must NOT be inlined by the compiler — otherwise no call site exists for PhASAR to intercept. For activity functions, apply __attribute__((noinline)) via a com.stigway.gradle.tasks.analysis.StigPatchSpec before declaring them as sanitizers.

Parameters

symbol

LLVM symbol name of the sanitizer function.