Re: [PATCH] x86: suppress KMSAN reports in arch_within_stack_frames()

From: Peter Zijlstra
Date: Tue Nov 22 2022 - 03:17:47 EST


On Mon, Nov 21, 2022 at 03:27:49PM +0100, Alexander Potapenko wrote:

> In other words, for normal instrumentation:
> - locals are explicitly marked as uninitialized;
> - shadow values are calculated for arithmetic operations based on their inputs;
> - shadow values are checked for branches, pointer dereferences, and
> before passing them as function arguments;
> - memory stores update shadow for affected variables.
>
> For __no_kmsan_checks:
> - locals are explicitly marked as initialized;
> - no instrumentation is added for arithmetic operations, branches,
> pointer dereferences;
> - all function arguments are marked as initialized;
> - stores always mark memory as initialized.
>
> For __no_sanitize_memory:
> - no instrumentation for locals (they may end up being initialized or
> uninitialized - doesn't matter, because their shadow values are never
> used);
> - no instrumentation for arithmetic operations, branches, pointer dereferences;
> - no instrumentation for function calls (an instrumented function
> will receive garbage shadow values from a non-instrumented one);
> - no instrumentation for stores (initialization done in these
> functions is invisible).

Thanks! That is a great summary.