public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jann Horn <jannh@google.com>, Kees Cook <kees@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux LLVM <llvm@lists.linux.dev>,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: CONFIG_UBSAN_TRAP #UD error message on x86 [was: Re: [CRASH][BISECTED] 6.4.1 crash in boot]
Date: Wed, 5 Jul 2023 14:54:01 -0700	[thread overview]
Message-ID: <202307051453.007A5ED7@keescook> (raw)
In-Reply-To: <20230705213113.GC2813335@hirez.programming.kicks-ass.net>

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

  reply	other threads:[~2023-07-05 21:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-02 16:36 [CRASH][BISECTED] 6.4.1 crash in boot Mirsad Goran Todorovac
2023-07-03  1:44 ` Bagas Sanjaya
2023-07-03  3:20   ` Kees Cook
2023-07-03  3:26     ` Guenter Roeck
2023-07-03  3:53       ` Mirsad Goran Todorovac
2023-07-03  4:30         ` Kees Cook
2023-07-03  4:38           ` Guenter Roeck
2023-07-03  4:53             ` Kees Cook
2023-07-03  4:50           ` Mirsad Goran Todorovac
2023-07-03  3:58       ` Guenter Roeck
2023-07-03  5:18         ` Mirsad Goran Todorovac
2023-07-03  5:18         ` Mirsad Goran Todorovac
2023-07-03  5:41           ` Kees Cook
2023-07-03  7:03             ` Mirsad Goran Todorovac
2023-07-03 19:03               ` Kees Cook
2023-07-03 23:09                 ` Kees Cook
2023-07-04 17:20                   ` Mirsad Todorovac
2023-07-04 21:36                     ` Kees Cook
2023-07-04 23:15                       ` Mirsad Todorovac
2023-07-05  2:09                         ` Kees Cook
2023-07-05  5:18                           ` Mirsad Todorovac
2023-07-05 15:16                           ` CONFIG_UBSAN_TRAP #UD error message on x86 [was: Re: [CRASH][BISECTED] 6.4.1 crash in boot] Jann Horn
2023-07-05 21:08                             ` Kees Cook
2023-07-05 21:31                               ` Peter Zijlstra
2023-07-05 21:54                                 ` Kees Cook [this message]
2023-07-06  5:02                           ` [CRASH][BISECTED] 6.4.1 crash in boot Mirsad Todorovac
2023-07-03  3:40   ` Mirsad Goran Todorovac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202307051453.007A5ED7@keescook \
    --to=keescook@chromium.org \
    --cc=jannh@google.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox