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

2024-07-11 Thread Peter Zijlstra
On Thu, Jul 11, 2024 at 09:35:24AM -0700, Kees Cook wrote: > On Thu, Jul 11, 2024 at 11:06:12AM +0200, Marco Elver wrote: > > On Thu, 11 Jul 2024 at 10:10, Peter Zijlstra wrote: > > > > > > On Wed, Jul 10, 2024 at 08:32:38PM +, Gatlin Newhouse wrote: > > > > Currently ARM architectures extract

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

2024-07-11 Thread Kees Cook
On Thu, Jul 11, 2024 at 11:06:12AM +0200, Marco Elver wrote: > On Thu, 11 Jul 2024 at 10:10, Peter Zijlstra wrote: > > > > On Wed, Jul 10, 2024 at 08:32:38PM +, Gatlin Newhouse wrote: > > > Currently ARM architectures extract which specific sanitizer > > > has caused a trap via encoded data in

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

2024-07-11 Thread Marco Elver
On Thu, 11 Jul 2024 at 10:10, Peter Zijlstra wrote: > > On Wed, Jul 10, 2024 at 08:32:38PM +, Gatlin Newhouse wrote: > > Currently ARM architectures extract which specific sanitizer > > has caused a trap via encoded data in the trap instruction. > > Clang on x86 currently encodes the same data

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

2024-07-11 Thread Peter Zijlstra
On Wed, Jul 10, 2024 at 08:32:38PM +, Gatlin Newhouse wrote: > Currently ARM architectures extract which specific sanitizer > has caused a trap via 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_bu

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

2024-07-10 Thread Gatlin Newhouse
Currently ARM architectures extract which specific sanitizer has caused a trap via 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. Bring x86 to parity with