lkml.org 
[lkml]   [2020]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 18/20] kasan: clean up metadata allocation and usage
On Thu, Nov 12, 2020 at 12:06 AM Marco Elver <elver@google.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!

\
 
 \ /
  Last update: 2020-11-12 21:12    [W:1.442 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site