Re: [PATCH 43/82] bpf: Refactor intentional wrap-around test

2024-01-22 Thread Yonghong Song
On 1/22/24 8:07 PM, Kees Cook wrote: On January 22, 2024 8:00:26 PM PST, Yonghong Song wrote: On 1/22/24 4:27 PM, 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 th

Re: [PATCH 43/82] bpf: Refactor intentional wrap-around test

2024-01-22 Thread Kees Cook
On January 22, 2024 8:00:26 PM PST, Yonghong Song wrote: > >On 1/22/24 4:27 PM, 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 o

Re: [PATCH 43/82] bpf: Refactor intentional wrap-around test

2024-01-22 Thread Yonghong Song
On 1/22/24 4:27 PM, 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, this is considered "un

[PATCH 43/82] bpf: 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