Thread (30 messages) flat view 30 messages, 3 authors, 2021-01-14

Re: [PATCH v2 11/14] kasan: fix bug detection via ksize for HW_TAGS mode

From: Marco Elver <elver@google.com>
Date: 2021-01-14 19:57:19
Also in: linux-arm-kernel, lkml

On Thu, 14 Jan 2021 at 19:01, 'Andrey Konovalov' via kasan-dev
[off-list ref] wrote:
On Wed, Jan 13, 2021 at 5:54 PM Marco Elver [off-list ref] wrote:
quoted
quoted
+/*
+ * Unlike kasan_check_read/write(), kasan_check_byte() is performed even for
+ * the hardware tag-based mode that doesn't rely on compiler instrumentation.
+ */
+bool __kasan_check_byte(const void *addr, unsigned long ip);
+static __always_inline bool kasan_check_byte(const void *addr, unsigned long ip)
+{
+       if (kasan_enabled())
+               return __kasan_check_byte(addr, ip);
+       return true;
+}
Why was this not added to kasan-checks.h? I'd assume including all of
kasan.h is also undesirable for tag-based modes if we just want to do
a kasan_check_byte().
It requires kasan_enabled() definition. I can move both to
kasan-checks.h if you prefer. However, the only place where
kasan_check_byte() is currently used includes kasan.h anyway.
Hmm, if it makes too much of a mess, let's just leave as-is.

Thanks,
-- Marco
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help