Re: [PATCH v15 13/25] x86/reboot: Add ljmp instructions to stacktool whitelist
From: Borislav Petkov
Date: Tue Jan 12 2016 - 14:37:32 EST
On Tue, Jan 12, 2016 at 12:56:06PM -0600, Josh Poimboeuf wrote:
> I'd say those are all weird things that C code should _normally_ not do
> (especially emitting fake instructions!).
The kernel does weird things, that's fine.
> Generally I agree (but I don't know what other tools you're talking
> about which require adding clutter).
kasan and kmemleak, for example.
> As I said there's hopefully only a handful of code locations which
> need the STACKTOOL_IGNORE stuff.
Can you get rid of them too?
> For example, how can it possibly grok a fake xen instruction without
> some kind of a whitelist, either hard-coded in the tool or annotated
> some other way?
I'd much prefer a whitelist which the tool parses, loads, etc, if you
don't want to hardcode it, to annotating kernel code.
> For example, how can it possibly grok a fake xen instruction without
> some kind of a whitelist, either hard-coded in the tool or annotated
> some other way?
Pointer to the place? I could take a look when I get a chance.
> Saying nothing at all in order to prevent false positives would also
> by definition allow some false negatives, which would make stacktool
> useless for its intended purpose of enabling reliable stack traces.
I'd take output from the tool anyday of the week which says something
like: "Looka here, this looks funny, you might want to do something
about it." than imposing annotations on code.
It might even move people into rewriting the code into tool-compliant
version.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.