[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+x1rPq_UCU8rCFhpqQvcT-cX3=-ccE77bwbwZViDfhvpQ@mail.gmail.com>
Date: Fri, 18 Sep 2020 12:39:39 +0200
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Alexander Potapenko <glider@...gle.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Catalin Marinas <catalin.marinas@....com>,
kasan-dev <kasan-dev@...glegroups.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Marco Elver <elver@...gle.com>,
Evgenii Stepanov <eugenis@...gle.com>,
Elena Petrova <lenaptr@...gle.com>,
Branislav Rankov <Branislav.Rankov@....com>,
Kevin Brodsky <kevin.brodsky@....com>,
Will Deacon <will.deacon@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
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 07/37] kasan: split out shadow.c from common.c
On Fri, Sep 18, 2020 at 10:17 AM Alexander Potapenko <glider@...gle.com> wrote:
>
> > 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.
Will do in v3.
> > +#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?
Hardware mode uses native memset implementation as all memory access
instructions are checked by the hardware anyway.
> > + 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?
This patch just moves the already existing code, but I can fix this in
a separate patch.
Powered by blists - more mailing lists