Re: [PATCH v2 14/19] lib/stackdepot, kasan: add flags to __stack_depot_save and rename

Alexander Potapenko
2023-10-09T10:10:42Z

On Wed, Sep 13, 2023 at 7:17 PM <andrey.konovalov@linux.dev> wrote:
>
> From: Andrey Konovalov <andreyknvl@google.com>
>
> Change the bool can_alloc argument of __stack_depot_save to a
> u32 argument that accepts a set of flags.
>
> The following patch will add another flag to stack_depot_save_flags
> besides the existing STACK_DEPOT_FLAG_CAN_ALLOC.
>
> Also rename the function to stack_depot_save_flags, as __stack_depot_save
> is a cryptic name,
>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
(assuming you'll address Marco's comment)

...

> void kasan_record_aux_stack_noalloc(void *addr)
> {
> - return __kasan_record_aux_stack(addr, false);
> + return __kasan_record_aux_stack(addr, 0);

Maybe make the intent to not allocate more explicit by declaring some
STACK_DEPOT_FLAG_CAN_NOT_ALLOC = 0?
(Leaving this up to you)