[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202307051453.007A5ED7@keescook>
Date: Wed, 5 Jul 2023 14:54:01 -0700
From: Kees Cook <keescook@...omium.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Jann Horn <jannh@...gle.com>, Kees Cook <kees@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux LLVM <llvm@...ts.linux.dev>,
the arch/x86 maintainers <x86@...nel.org>
Subject: Re: CONFIG_UBSAN_TRAP #UD error message on x86 [was: Re:
[CRASH][BISECTED] 6.4.1 crash in boot]
On Wed, Jul 05, 2023 at 11:31:13PM +0200, Peter Zijlstra wrote:
> On Wed, Jul 05, 2023 at 02:08:09PM -0700, Kees Cook wrote:
>
> > > Even just a "WARNING: CONFIG_UBSAN_TRAP active, #UD might be caused by
> > > that" on every #UD that does not come from a known BUG() location or
> > > such might be better than nothing...
> >
> > I've considered it, but usually CONFIG_UBSAN_TRAP isn't accidentally
> > set. Also, the crash info is something we can get help from on the
> > compiler side, to mark up where the traps are, similar to what we do
> > with KCFI, but it hasn't happened yet for x86. For example, arm64
> > already encodes the details in the trap instruction itself:
> > https://git.kernel.org/linus/25b84002afb9dc9a91a7ea67166879c13ad82422
>
> Right, so you could easily use a different #UD instruction that has an
> immediate, something like:
>
> 0f b9 40 ff ud1 -0x1(%rax),%rax
Ah yeah, that would be easier, probably. It could match what arm64 does.
--
Kees Cook
Powered by blists - more mailing lists