lkml.org 
[lkml]   [2020]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 07/37] kasan: split out shadow.c from common.c
> diff --git a/mm/kasan/shadow.c b/mm/kasan/shadow.c
> new file mode 100644
> index 000000000000..4888084ecdfc
> --- /dev/null
> +++ b/mm/kasan/shadow.c
> @@ -0,0 +1,509 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * This file contains KASAN shadow runtime code.

I think it will be nice to mention here which KASAN modes are going to
use this file.



> +#undef memset
> +void *memset(void *addr, int c, size_t len)
> +{
> + if (!check_memory_region((unsigned long)addr, len, true, _RET_IP_))
> + return NULL;
> +
> + return __memset(addr, c, len);
> +}
> +

OOC, don't we need memset and memmove implementations in the
hardware-based mode as well?


> + region_start = ALIGN(start, PAGE_SIZE * KASAN_GRANULE_SIZE);
> + region_end = ALIGN_DOWN(end, PAGE_SIZE * KASAN_GRANULE_SIZE);

"PAGE_SIZE * KASAN_GRANULE_SIZE" seems to be a common thing, can we
give it a name?

\
 
 \ /
  Last update: 2020-09-18 10:18    [W:0.359 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site