Re: [PATCH] kasan: test: Consolidate workarounds for unwanted __alloc_size() protection

From: Arnd Bergmann
Date: Wed Oct 20 2021 - 15:41:24 EST


On Wed, Oct 20, 2021 at 9:38 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>
> This fixes kasan-test-use-underlying-string-helpers.patch to avoid needing
> new helpers. As done in kasan-test-bypass-__alloc_size-checks.patch,
> just use OPTIMIZER_HIDE_VAR(). Additionally converts a use of
> "volatile", which was trying to work around similar detection.
>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx>
> Cc: Alexander Potapenko <glider@xxxxxxxxxx>
> Cc: Andrey Konovalov <andreyknvl@xxxxxxxxx>
> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> Cc: kasan-dev@xxxxxxxxxxxxxxxx
> Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>

Yes, that's much better than my version

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>