Thread (11 messages) 11 messages, 4 authors, 2020-01-16

Re: [PATCH 1/2] kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE

From: Daniel Axtens <hidden>
Date: 2020-01-16 05:34:30
Also in: linux-arm-kernel, linux-mm, linux-s390, lkml

quoted
quoted
quoted
+/*
+ * We assign some test results to these globals to make sure the tests
+ * are not eliminated as dead code.
+ */
+
+int int_result;
+void *ptr_result;
These are globals, but are not static and don't have kasan_ prefix.
But I guess this does not matter for modules?
Otherwise:

Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
I think if you make them static, GCC will see they aren't used and will
eliminate everything still ?
static volatile? :)
Yeah so these are module globals. They'd be accessible from any other
files you linked into the module (currently there are no such
files). They're not visible outside the module because they're not
EXPORTed.

Making them static does lead to them getting eliminated, and 'static
volatile' seems both gross and like something checkpatch would complain
about. I'll leave them as they are but stick a kasan_ prefix on them
just for the additional tidiness.

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