Re: [PATCH] bitops.h: sanitize rotate primitives

2019-04-16 Thread Will Deacon
On Wed, Apr 10, 2019 at 11:19:06PM +0200, Rasmus Villemoes wrote: > The ror32 implementation (word >> shift) | (word << (32 - shift) has > undefined behaviour if shift is outside the [1, 31] range. Similarly > for the 64 bit variants. Most callers pass a compile-time > constant (naturally in that

Re: [PATCH] bitops.h: sanitize rotate primitives

2019-04-11 Thread Ido Schimmel
On Wed, Apr 10, 2019 at 11:19:06PM +0200, Rasmus Villemoes wrote: > The ror32 implementation (word >> shift) | (word << (32 - shift) has > undefined behaviour if shift is outside the [1, 31] range. Similarly > for the 64 bit variants. Most callers pass a compile-time > constant (naturally in that

[PATCH] bitops.h: sanitize rotate primitives

2019-04-10 Thread Rasmus Villemoes
The ror32 implementation (word >> shift) | (word << (32 - shift) has undefined behaviour if shift is outside the [1, 31] range. Similarly for the 64 bit variants. Most callers pass a compile-time constant (naturally in that range), but there's an UBSAN report that these may actually be called with