[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+fCnZfOGRh67SUNxQ2cyZLK8JV56GV_sa8AnNeURcgHif5Yzg@mail.gmail.com>
Date: Tue, 29 Mar 2022 20:36:46 +0200
From: Andrey Konovalov <andreyknvl@...il.com>
To: Marco Elver <elver@...gle.com>
Cc: andrey.konovalov@...ux.dev,
Alexander Potapenko <glider@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
kasan-dev <kasan-dev@...glegroups.com>,
Mark Rutland <mark.rutland@....com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Peter Collingbourne <pcc@...gle.com>,
Evgenii Stepanov <eugenis@...gle.com>,
Florian Mayer <fmayer@...gle.com>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrey Konovalov <andreyknvl@...gle.com>
Subject: Re: [PATCH v2 4/4] kasan: use stack_trace_save_shadow
On Mon, Mar 28, 2022 at 2:49 PM Marco Elver <elver@...gle.com> wrote:
>
> > diff --git a/mm/kasan/common.c b/mm/kasan/common.c
> > index d9079ec11f31..8d9d35c6562b 100644
> > --- a/mm/kasan/common.c
> > +++ b/mm/kasan/common.c
> > @@ -33,10 +33,13 @@
> > depot_stack_handle_t kasan_save_stack(gfp_t flags, bool can_alloc)
> > {
> > unsigned long entries[KASAN_STACK_DEPTH];
> > - unsigned int nr_entries;
> > + unsigned int size;
>
> Why did this variable name change?
So the lines below fit within one line. It won't be needed with the
other change you suggested.
> > - nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 0);
> > - return __stack_depot_save(entries, nr_entries, flags, can_alloc);
> > + if (IS_ENABLED(CONFIG_HAVE_SHADOW_STACKTRACE))
>
> Would it be more reliable to check the return-code? I.e. do:
>
> int size;
>
> size = stack_trace_save_shadow(...)
> if (size < 0)
> size = stack_trace_save(...);
Sounds good, will do in v3.
Thanks!
Powered by blists - more mailing lists