Thread (27 messages) 27 messages, 4 authors, 2021-01-21

Re: [PATCH v4 2/5] kasan: Add KASAN mode kernel parameter

From: Andrey Konovalov <hidden>
Date: 2021-01-19 18:30:19
Also in: lkml

On Mon, Jan 18, 2021 at 7:30 PM Vincenzo Frascino
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
--- a/Documentation/dev-tools/kasan.rst
+++ b/Documentation/dev-tools/kasan.rst
@@ -162,6 +162,9 @@ particular KASAN features.

 - ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``).

+- ``kasan.mode=sync`` or ``=async`` controls whether KASAN is configured in
+  synchronous or asynchronous mode of execution (default: ``sync``).
This needs to be expanded with a short explanation of the difference.
+static inline void hw_enable_tagging_mode(void)
+{
+       if (kasan_arg_mode == KASAN_ARG_MODE_ASYNC)
+               hw_enable_tagging_async();
+       else
+               hw_enable_tagging_sync();
+}
It's OK to open-code this in kasan_init_hw_tags_cpu(), no need for an
additional function.
quoted hunk ↗ jump to hunk
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -284,7 +284,8 @@ static inline const void *arch_kasan_set_tag(const void *addr, u8 tag)
 #define arch_set_mem_tag_range(addr, size, tag) ((void *)(addr))
 #endif

-#define hw_enable_tagging()                    arch_enable_tagging()
+#define hw_enable_tagging_sync()               arch_enable_tagging_sync()
+#define hw_enable_tagging_async()              arch_enable_tagging_async()
This is one of the places that conflicts with the testing patches.
You'll need to: add an else case definition of
hw_enable_tagging_sync(); change lib/test_kasan.c to use
hw_enable_tagging_sync().

I'll later add a patch on top that forbids running the tests with the
async mode.

_______________________________________________
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