[PATCH] x86/traps: Enable UBSAN traps on x86

2024-05-28 Thread Gatlin Newhouse
sanitizer caused the trap, via the encoded data in the trap instruction. Clang on x86 currently encodes the same data in ud1 instructions but the x86 handle_bug() and is_valid_bugaddr() functions currently only look at ud2s. Signed-off-by: Gatlin Newhouse --- MAINTAINERS | 2 ++

Re: [PATCH] x86/traps: Enable UBSAN traps on x86

2024-05-29 Thread Gatlin Newhouse
On Wed, May 29, 2024 at 09:25:21AM UTC, Marco Elver wrote: > On Wed, 29 May 2024 at 04:20, Gatlin Newhouse > wrote: > [...] > > if (regs->flags & X86_EFLAGS_IF) > > raw_local_irq_enable(); > > - if (report_bug(reg

Re: [PATCH] x86/traps: Enable UBSAN traps on x86

2024-05-29 Thread Gatlin Newhouse
On Wed, May 29, 2024 at 08:30:20PM UTC, Marco Elver wrote: > On Wed, 29 May 2024 at 20:17, Gatlin Newhouse > wrote: > > > > On Wed, May 29, 2024 at 09:25:21AM UTC, Marco Elver wrote: > > > On Wed, 29 May 2024 at 04:20, Gatlin Newhouse > > > wrote: > &g

Re: [PATCH] x86/traps: Enable UBSAN traps on x86

2024-05-31 Thread Gatlin Newhouse
On Thu, May 30, 2024 at 01:24:56AM UTC, Andrew Cooper wrote: > On 29/05/2024 3:20 am, Gatlin Newhouse wrote: > > diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h > > index a3ec87d198ac..e3fbed9073f8 100644 > > --- a/arch/x86/include/asm/bug.h > >

[PATCH v2] x86/traps: Enable UBSAN traps on x86

2024-05-31 Thread Gatlin Newhouse
sanitizer caused the trap, via the encoded data in the trap instruction. Clang on x86 currently encodes the same data in ud1 instructions but the x86 handle_bug() and is_valid_bugaddr() functions currently only look at ud2s. Signed-off-by: Gatlin Newhouse --- Changes in v2: - Name the new

Re: [PATCH v2] x86/traps: Enable UBSAN traps on x86

2024-06-11 Thread Gatlin Newhouse
On Mon, Jun 03, 2024 at 06:13:53PM UTC, Thomas Gleixner wrote: > On Sat, Jun 01 2024 at 03:10, Gatlin Newhouse wrote: > > > Bring x86 to parity with arm64, similar to commit 25b84002afb9 > > ("arm64: Support Clang UBSAN trap codes for better reporting"). > &g

[PATCH v3] x86/traps: Enable UBSAN traps on x86

2024-06-24 Thread Gatlin Newhouse
with arm64, similar to commit 25b84002afb9 ("arm64: Support Clang UBSAN trap codes for better reporting"). Enable the output of UBSAN type information on x86 architectures compiled with clang when CONFIG_UBSAN_TRAP=y. Signed-off-by: Gatlin Newhouse --- Changes in v3: - Address Thomas

[PATCH v4] x86/traps: Enable UBSAN traps on x86

2024-07-10 Thread Gatlin Newhouse
arm64, similar to commit 25b84002afb9 ("arm64: Support Clang UBSAN trap codes for better reporting"). Enable the reporting of UBSAN sanitizer detail on x86 architectures compiled with clang when CONFIG_UBSAN_TRAP=y. Signed-off-by: Gatlin Newhouse --- Changes in v4: - Impleme

[PATCH v5] x86/traps: Enable UBSAN traps on x86

2024-07-23 Thread Gatlin Newhouse
ned-off-by: Gatlin Newhouse --- Changes in v5: - Added references to the LLVM commits in the commit message from Kees and Marco's feedback - Renamed incorrect defines, and removed handle_ubsan_failure()'s duplicated work per Peter's feedback Changes in v4: - Implemen