[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200317210008.bda4c542b5lu7juf@treble>
Date: Tue, 17 Mar 2020 16:00:08 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: tglx@...utronix.de, linux-kernel@...r.kernel.org, x86@...nel.org,
mhiramat@...nel.org, mbenes@...e.cz, brgerst@...il.com
Subject: Re: [PATCH v2 16/19] objtool: Implement noinstr validation
On Tue, Mar 17, 2020 at 06:02:50PM +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"
I'm not sure I see the point of the --vmlinux option, when it will be
autodetected anyway?
> @@ -46,5 +49,9 @@ int cmd_check(int argc, const char **arg
>
> objname = argv[0];
>
> + s = strstr(objname, "vmlinux.o");
> + if (s && !s[9])
> + vmlinux = true;
> +
I think this would be slightly cleaner:
if (!strcmp(basename(objname), "vmlinux.o"))
vmlinux = true;
--
Josh
Powered by blists - more mailing lists