Re: [PATCH v3 19/26] objtool: Implement noinstr validation
From: Josh Poimboeuf
Date: Tue Mar 24 2020 - 17:42:12 EST
On Tue, Mar 24, 2020 at 04:31:32PM +0100, Peter Zijlstra wrote:
> Validate that any call out of .noinstr.text is in between
> instr_begin() and instr_end() annotations.
>
> This annotation is useful to ensure correct behaviour wrt tracing
> sensitive code like entry/exit and idle code. When we run code in a
> sensitive context we want a guarantee no unknown code is ran.
>
> Since this validation relies on knowing the section of call
> destination symbols, we must run it on vmlinux.o instead of on
> individual object files.
>
> Add two options:
>
> -d/--duplicate "duplicate validation for vmlinux"
> -l/--vmlinux "vmlinux.o validation"
>
> Where the latter auto-detects when objname ends with "vmlinux.o" and
> the former will force all validations, also those already done on
> !vmlinux object files.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
--
Josh