This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add support for KernelAddressSanitizer
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Yury Gribov <y dot gribov at samsung dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Dmitry Vyukov <dvyukov at google dot com>, Konstantin Serebryany <kcc at gcc dot gnu dot org>, Andrey Ryabinin <a dot ryabinin at samsung dot com>
- Date: Fri, 18 Jul 2014 14:26:25 +0200
- Subject: Re: [PATCH] Add support for KernelAddressSanitizer
- Authentication-results: sourceware.org; auth=none
- References: <53C9079F dot 3060907 at samsung dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jul 18, 2014 at 03:40:15PM +0400, Yury Gribov wrote:
> This tiny patch adds support for KernelASan. KASan brings Asan error
> detection capabilities to Linux kernel
> KASan works similar to normal userspace ASan but disables some options which
> are not yet supported by kernel (notably inline instrumentation,
> stack/global protection and UAR). We would prefer to hide all necessary
> tweaks under a user-friendly flag (-fsanitize=kernel-address) instead of
> forcing them directly in kernel's CFLAGS.
> Kernel patches are currently under review in LKML
I thought KAsan used different entry points (__kasan_* etc.), has that
Also, oring in SANITIZER_ADDRESS means you add -lasan to link flags, I'd
guess that for -fsanitize=kernel-address you don't want to add any libraries
at link time?
Do you error out on -fsanitize=thread -fsanitize=kernel-address ?
Perhaps -fsanitize=kernel-address -fsanitize=address should be invalid too?