Messages in this thread | | | From | Alexander Potapenko <> | Date | Wed, 11 Nov 2020 17:19:28 +0100 | Subject | Re: [PATCH v9 23/44] kasan: separate metadata_fetch_row for each mode |
| |
On Wed, Nov 11, 2020 at 4:22 PM Alexander Potapenko <glider@google.com> wrote: > > On Tue, Nov 10, 2020 at 11:12 PM Andrey Konovalov <andreyknvl@google.com> wrote: > > > > This is a preparatory commit for the upcoming addition of a new hardware > > tag-based (MTE-based) KASAN mode. > > > > Rework print_memory_metadata() to make it agnostic with regard to the > > way metadata is stored. Allow providing a separate metadata_fetch_row() > > implementation for each KASAN mode. Hardware tag-based KASAN will provide > > its own implementation that doesn't use shadow memory. > > > > No functional changes for software modes. > > > > Signed-off-by: Andrey Konovalov <andreyknvl@google.com> > > Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> > > Reviewed-by: Marco Elver <elver@google.com> Reviewed-by: Alexander Potapenko <glider@google.com>
> > +void metadata_fetch_row(char *buffer, void *row) > > +{ > > + memcpy(buffer, kasan_mem_to_shadow(row), META_BYTES_PER_ROW); > > I think it is important to use __memcpy() instead of memcpy() in KASAN > runtime to avoid calling instrumented code.
Please disregard this. Turns out we define memcpy to __memcpy for non-instrumented files.
| |