Re: [PATCH 22/82] x86/sgx: Refactor intentional wrap-around calculation

2024-01-23 Thread Jarkko Sakkinen
On Tue Jan 23, 2024 at 12:26 AM UTC, 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 > > Notably,

[PATCH 22/82] x86/sgx: Refactor intentional wrap-around calculation

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