linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>, <andreyknvl@google.com>,
	<kasan-dev@googlegroups.com>, <linux-kernel@vger.kernel.org>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: [PATCH v2] kasan: turn on -fsanitize-address-use-after-scope
Date: Thu, 8 Dec 2016 17:39:37 +0300	[thread overview]
Message-ID: <1481207977-28654-1-git-send-email-aryabinin@virtuozzo.com> (raw)
In-Reply-To: <CACT4Y+YBgdBV7dUPZjX7zz6Kebn-k0ocWn_2bQzDd9CGbCAu4Q@mail.gmail.com>

In the upcoming gcc7 release, the -fsanitize=kernel-address option
at first implied new -fsanitize-address-use-after-scope option.
This would cause link errors on older kernels because they don't have
two new functions required for use-after-scope support. Therefore,
gcc7 changed default to -fno-sanitize-address-use-after-scope.

Now the kernel has everything required for that feature since
commit 828347f8f9a5 ("kasan: support use-after-scope detection").
So, to make it work, we just have to enable use-after-scope in CFLAGS.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
---
Changes since v1:
   - s/release release/relase in changelog
   - added Ack

 scripts/Makefile.kasan | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
index 37323b0..9576775 100644
--- a/scripts/Makefile.kasan
+++ b/scripts/Makefile.kasan
@@ -28,4 +28,6 @@ else
         CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
     endif
 endif
+
+CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope)
 endif
-- 
2.7.3

      reply	other threads:[~2016-12-08 17:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 12:48 [PATCH] kasan: turn on -fsanitize-address-use-after-scope Andrey Ryabinin
2016-12-08 14:34 ` Dmitry Vyukov
2016-12-08 14:39   ` Andrey Ryabinin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1481207977-28654-1-git-send-email-aryabinin@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).