[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180518071814.GB26358@gmail.com>
Date: Fri, 18 May 2018 09:18:14 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Peter Anvin <h.peter.anvin@...el.com>,
kernel test robot <xiaolong.ye@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Brian Gerst <brgerst@...il.com>,
Denys Vlasenko <dvlasenk@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Peter Anvin <hpa@...or.com>, tipbuild@...or.com,
LKP <lkp@...org>
Subject: Re: [PATCH] objtool: Detect assembly code falling through to INT3
padding
* Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> With the following commit:
>
> 51bad67ffbce ("x86/asm: Pad assembly functions with INT3 instructions")
>
> ... asm function alignments are padded with INT3, so it's no longer safe
> to fall through to an aligned function. Make sure we catch any such
> cases with objtool.
>
> Note this only adds checking for 64-bit, since objtool doesn't support
> x86-32.
>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
> ---
> arch/x86/kernel/head_64.S | 2 --
> tools/objtool/arch.h | 3 ++-
> tools/objtool/arch/x86/decode.c | 2 +-
> tools/objtool/check.c | 11 ++++++++++-
> 4 files changed, 13 insertions(+), 5 deletions(-)
Ok, this is cool, it addresses the robustness problem that INT3 padding introduced
very nicely.
The concept of built-in kernel tooling working at the machine code level is just
so powerful - we should have added our own KCC compiler 20 years ago.
Thanks,
Ingo
Powered by blists - more mailing lists