[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+wwC7zETg_0VQab-mMhssNwC0_aoh3HqRVqN9SrZTMSKA@mail.gmail.com>
Date: Thu, 12 Nov 2020 21:11:43 +0100
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Marco Elver <elver@...gle.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Evgenii Stepanov <eugenis@...gle.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Branislav Rankov <Branislav.Rankov@....com>,
Kevin Brodsky <kevin.brodsky@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
kasan-dev <kasan-dev@...glegroups.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 18/20] kasan: clean up metadata allocation and usage
On Thu, Nov 12, 2020 at 12:06 AM Marco Elver <elver@...gle.com> wrote:
>
> > + /* Limit it with KMALLOC_MAX_SIZE (relevant for SLAB only). */
> > + if (optimal_size > KMALLOC_MAX_SIZE)
> > + optimal_size = KMALLOC_MAX_SIZE;
> > + /* Use optimal size if the size with added metas is not large enough. */
>
> Uses the optimal size if it's not "too large" rather than "not large
> enough", right?
Not really. If the redzone composed from metas is begger than optimal
redzone - we're good. If it's not large enough to reach optimal
redzone - we need to make it bigger.
> As it is worded now makes me think this is a fallback,
> whereas ideally it's the common case, right?
It's hard to say which case is more common, as optimal redzone size
varies and depends on the object size.
[...]
Will fix the rest of the comments, thanks!
Powered by blists - more mailing lists