This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add support for KernelAddressSanitizer
- From: Yury Gribov <y dot gribov at samsung dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Dmitry Vyukov <dvyukov at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Konstantin Serebryany <kcc at gcc dot gnu dot org>, Andrey Ryabinin <a dot ryabinin at samsung dot com>
- Date: Fri, 18 Jul 2014 18:15:48 +0400
- Subject: Re: [PATCH] Add support for KernelAddressSanitizer
- Authentication-results: sourceware.org; auth=none
- References: <53C9079F dot 3060907 at samsung dot com> <20140718122625 dot GC3003 at laptop dot redhat dot com> <CACT4Y+Z5tRuAs+KBc83feeMj8zaY5Atqy7OTzxpqkYpcp_JyXg at mail dot gmail dot com> <20140718133838 dot GE3003 at laptop dot redhat dot com>
Then in sanitize_spec_function supposedly for "address" check
SANITIZE_USER_ADDRESS bit, for "kernel-address" added there
SANITIZE_KERNEL_ADDRESS, add all the incompatibility diagnostics for the new
Plus, toplev.c has e.g.:
Now, is the same really the case for SANITIZE_KERNEL_ADDRESS?
This is a good point, KASan does not use asan_shadow_offset
so this check is redundant.
I guess we still inline the shadow memory accesses to poison/unpoison
stack in function prologue/epilogue, right? In that case without
asan_shadow_offset we can't do anything. If it was a function call instead
it would be portable to all architectures.
Stack is not supported by current KASan. My local version indeed does
asan_shadow_offset with function call.