Re: UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-16 Thread Kees Cook
On Thu, Aug 15, 2024 at 12:40:12PM -0600, Jens Axboe wrote: > On 8/15/24 11:58 AM, Breno Leitao wrote: > >> 1) There exists some new-ish macros in overflow.h that perform > >> wrapping arithmetic without triggering sanitizer splats -- check out > >> the wrapping_* suite of macros. > > > > do they

Re: UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-15 Thread Jens Axboe
On 8/15/24 11:58 AM, Breno Leitao wrote: >> 1) There exists some new-ish macros in overflow.h that perform >> wrapping arithmetic without triggering sanitizer splats -- check out >> the wrapping_* suite of macros. > > do they work for atomic? I suppose we also need to have them added to > this_cpu

Re: UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-15 Thread Breno Leitao
Hello Justin, On Wed, Aug 14, 2024 at 02:05:49PM -0700, Justin Stitt wrote: > > I am seeing some signed-integer-overflow in percpu reference counters. > > it is brave of you to enable this sanitizer :>) UBSAN has been somehow useful to pick some problems, so, I try to invest some time understand

Re: UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-15 Thread Kees Cook
On Wed, Aug 14, 2024 at 02:05:49PM -0700, Justin Stitt wrote: > Hi, > > On Wed, Aug 14, 2024 at 10:10 AM Breno Leitao wrote: > > > > Hello, > > > > I am seeing some signed-integer-overflow in percpu reference counters. > > it is brave of you to enable this sanitizer :>) > > > > > UBSAN:

Re: UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-14 Thread Justin Stitt
Hi, On Wed, Aug 14, 2024 at 10:10 AM Breno Leitao wrote: > > Hello, > > I am seeing some signed-integer-overflow in percpu reference counters. it is brave of you to enable this sanitizer :>) > > UBSAN: signed-integer-overflow in > ./arch/arm64/include/asm/atomic_lse.h:204:1 > -

UBSAN: annotation to skip sanitization in variable that will wrap

2024-08-14 Thread Breno Leitao
Hello, I am seeing some signed-integer-overflow in percpu reference counters. UBSAN: signed-integer-overflow in ./arch/arm64/include/asm/atomic_lse.h:204:1 -9223372036854775808 - 1 cannot be represented in type 's64' (aka 'long long') Call trace: handle_overflo