Re: [PATCH 46/82] crypto: Refactor intentional wrap-around test

2024-01-22 Thread Kees Cook
On January 22, 2024 7:07:45 PM PST, Eric Biggers wrote: >Just to double check, you really intend to forbid *unsigned* integer >wraparound? >This patch's commit message focuses on signed, and barely mentions unsigned. >The actual code changes in this patch only deals with unsigned. I don't mea

Re: [PATCH 46/82] crypto: Refactor intentional wrap-around test

2024-01-22 Thread Eric Biggers
On Mon, Jan 22, 2024 at 04:27:21PM -0800, Kees Cook wrote: > In an effort to separate intentional arithmetic wrap-around from > unexpected wrap-around, we need to refactor places that depend on this > kind of math. One of the most common code patterns of this is: > > VAR + value < VAR > > N

[PATCH 46/82] crypto: Refactor intentional wrap-around test

2024-01-22 Thread Kees Cook
In an effort to separate intentional arithmetic wrap-around from unexpected wrap-around, we need to refactor places that depend on this kind of math. One of the most common code patterns of this is: VAR + value < VAR Notably, this is considered "undefined behavior" for signed and pointer

[PATCH 39/82] crypto: Refactor intentional wrap-around test

2024-01-22 Thread Kees Cook
In an effort to separate intentional arithmetic wrap-around from unexpected wrap-around, we need to refactor places that depend on this kind of math. One of the most common code patterns of this is: VAR + value < VAR Notably, this is considered "undefined behavior" for signed and pointer

Re: [PATCH] crypto: sun8i-ce - Use kcalloc() instead of kzalloc()

2024-01-22 Thread Gustavo A. R. Silva
On 1/21/24 09:34, Erick Archer wrote: As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them ove

Re: [PATCH] crypto: qat - use kcalloc_node() instead of kzalloc_node()

2024-01-22 Thread Gustavo A. R. Silva
On 1/21/24 10:40, Erick Archer wrote: As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them ove