On Wed, Feb 21, 2024 at 6:16 AM Kees Cook <keesc...@chromium.org> wrote:
>
> Mark the various refcount_t functions with __signed_wrap, as we depend
> on the wrapping behavior to detect the overflow and perform saturation.
> Silences warnings seen with the LKDTM REFCOUNT_* tests:
>
>   UBSAN: signed-integer-overflow in ../include/linux/refcount.h:189:11
>   2147483647 + 1 cannot be represented in type 'int'
>
> Signed-off-by: Kees Cook <keesc...@chromium.org>

Not sure why I am the "To:" (i.e. even if it is a change involving
only an addition of an attribute), but it looks good to me (UBSan is
triggering on the few `old + i`s caused by the calls from
`drivers/misc/lkdtm/refcount.c`, right?):

Reviewed-by: Miguel Ojeda <oj...@kernel.org>

As usual, thanks Kees for keeping up on getting the kernel (un)signed
UBSan-clean :)

Cheers,
Miguel

Reply via email to