[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG48ez0kmSqS_WJ1=neKpxKmMMkPYgNHfBD6ZSif_EWnso84wQ@mail.gmail.com>
Date: Wed, 5 Jul 2023 17:16:36 +0200
From: Jann Horn <jannh@...gle.com>
To: Kees Cook <kees@...nel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux LLVM <llvm@...ts.linux.dev>,
"the arch/x86 maintainers" <x86@...nel.org>
Subject: CONFIG_UBSAN_TRAP #UD error message on x86 [was: Re:
[CRASH][BISECTED] 6.4.1 crash in boot]
On Wed, Jul 5, 2023 at 4:10 AM Kees Cook <kees@...nel.org> wrote:
> On July 4, 2023 4:15:20 PM PDT, Mirsad Todorovac <mirsad.todorovac@....unizg.hr> wrote:
> >On 7/4/23 23:36, Kees Cook wrote:
> >> On July 4, 2023 10:20:11 AM PDT, Mirsad Todorovac <mirsad.todorovac@....unizg.hr> wrote:
> >>> all Wayland and X11.org GUI applications fail to start, with errors like this one:
> >>>
> >>> Jul 4 19:09:07 defiant kernel: [ 40.529719] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
> >>
> >> Hmm, is CONFIG_UBSAN_TRAP set?
> >
> >marvin@...iant:~/linux/kernel/linux_torvalds$ grep CONFIG_UBSAN_TRAP .config
> >CONFIG_UBSAN_TRAP=y
>
> Ah-ha! Turn that off please. With it off you will get much more useful reports from USBAN.
It might be useful if the x86 code under handle_invalid_op() at least
printed a warning about this when the kernel crashes with #UD on a
system with CONFIG_UBSAN_TRAP=y? It seems pretty unintuitive and
unhelpful that the kernel just crashes itself with a #UD and no
further information in this configuration.
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...
And maybe the Kconfig help text could be clearer on this, too.
Currently it does say that this turns warnings into "full exceptions
that abort the running kernel code" but it does not say that the
exception reporting will become pretty unhelpful, so it's probably not
really what you'd want for debugging.
Powered by blists - more mailing lists