Thread (107 messages) 107 messages, 6 authors, 2020-11-13

Re: [PATCH v9 23/44] kasan: separate metadata_fetch_row for each mode

From: Alexander Potapenko <glider@google.com>
Date: 2020-11-11 16:19:45
Also in: linux-mm, lkml

On Wed, Nov 11, 2020 at 4:22 PM Alexander Potapenko [off-list ref] wrote:
On Tue, Nov 10, 2020 at 11:12 PM Andrey Konovalov [off-list ref] wrote:
quoted
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 <redacted>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
quoted
+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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help