Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-07 Thread Kees Cook
On Wed, Feb 07, 2024 at 01:45:28AM +, Justin Stitt wrote: > I wouldn't mind also seeing a test_ubsan_div_overflow test case here. > > It has some quirky behavior and it'd be nice to test that the sanitizers > properly capture it. > > Check out this Godbolt: https://godbolt.org/z/qG5f1j6n1 >

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-06 Thread Justin Stitt
Hi, On Mon, Feb 05, 2024 at 01:37:29AM -0800, Kees Cook wrote: > In order to mitigate unexpected signed wrap-around[1], bring back the > signed integer overflow sanitizer. It was removed in commit 6aaa31aeb9cf > ("ubsan: remove overflow checks") because it was effectively a no-op > when combined w

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-06 Thread Kees Cook
On Mon, Feb 05, 2024 at 02:10:26PM +0100, Marco Elver wrote: > On Mon, 5 Feb 2024 at 13:59, Kees Cook wrote: > > > > On Mon, Feb 05, 2024 at 01:54:24PM +0100, Andrey Ryabinin wrote: > > > > > > > > > On 2/5/24 10:37, Kees Cook wrote: > > > > > > > --- > > > > include/linux/compiler_types.h | 9 +

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Marco Elver
On Mon, 5 Feb 2024 at 13:59, Kees Cook wrote: > > On Mon, Feb 05, 2024 at 01:54:24PM +0100, Andrey Ryabinin wrote: > > > > > > On 2/5/24 10:37, Kees Cook wrote: > > > > > --- > > > include/linux/compiler_types.h | 9 - > > > lib/Kconfig.ubsan | 14 +++ > > > lib/test_ubsan.c

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Kees Cook
On Mon, Feb 05, 2024 at 01:54:24PM +0100, Andrey Ryabinin wrote: > > > On 2/5/24 10:37, Kees Cook wrote: > > > --- > > include/linux/compiler_types.h | 9 - > > lib/Kconfig.ubsan | 14 +++ > > lib/test_ubsan.c | 37 ++ > > lib/ubsan.c

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Andrey Ryabinin
On 2/5/24 10:37, Kees Cook wrote: > --- > include/linux/compiler_types.h | 9 - > lib/Kconfig.ubsan | 14 +++ > lib/test_ubsan.c | 37 ++ > lib/ubsan.c| 68 ++ > lib/ubsan.h

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Kees Cook
On Mon, Feb 05, 2024 at 12:29:21PM +0100, Marco Elver wrote: > On Mon, 5 Feb 2024 at 10:37, Kees Cook wrote: > > > > In order to mitigate unexpected signed wrap-around[1], bring back the > > signed integer overflow sanitizer. It was removed in commit 6aaa31aeb9cf > > ("ubsan: remove overflow check

Re: [PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Marco Elver
On Mon, 5 Feb 2024 at 10:37, Kees Cook wrote: > > In order to mitigate unexpected signed wrap-around[1], bring back the > signed integer overflow sanitizer. It was removed in commit 6aaa31aeb9cf > ("ubsan: remove overflow checks") because it was effectively a no-op > when combined with -fno-strict

[PATCH v3] ubsan: Reintroduce signed overflow sanitizer

2024-02-05 Thread Kees Cook
In order to mitigate unexpected signed wrap-around[1], bring back the signed integer overflow sanitizer. It was removed in commit 6aaa31aeb9cf ("ubsan: remove overflow checks") because it was effectively a no-op when combined with -fno-strict-overflow (which correctly changes signed overflow from b