From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbbDQEoX (ORCPT ); Fri, 17 Apr 2015 00:44:23 -0400 Received: from smtprelay0134.hostedemail.com ([216.40.44.134]:49132 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750735AbbDQEoT (ORCPT ); Fri, 17 Apr 2015 00:44:19 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2693:2828:2901:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:4385:4470:4605:5007:6119:6120:6261:7875:7901:7903:8603:10004:10400:10848:11026:11232:11473:11658:11914:12198:12296:12438:12517:12519:12555:12740:13161:13229:14394:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: hat70_7c70d5152bc53 X-Filterd-Recvd-Size: 4160 Message-ID: <1429245851.2850.76.camel@perches.com> Subject: [PATCH] kasan: Show gcc version requirements in Kconfig and Documentation From: Joe Perches To: Sasha Levin Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Andrew Morton , Arnaldo Carvalho de Melo , Namhyung Kim , Masami Hiramatsu , Mathieu Desnoyers , Guilherme Cox , Tony Luck , Xie XiuQi Date: Thu, 16 Apr 2015 21:44:11 -0700 In-Reply-To: <5530852A.70202@oracle.com> References: <20150403013802.220157513@goodmis.org> <20150403014123.997385206@goodmis.org> <552E661D.5060502@oracle.com> <20150415100549.09cabb59@gandalf.local.home> <552F0937.4010009@oracle.com> <20150416232116.39cd9f74@grimm.local.home> <5530852A.70202@oracle.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The documentation shows a need for gcc > 4.9.2, but it's really >=. The Kconfig entries don't show require versions so add them. Correct a latter/later typo too. Signed-off-by: Joe Perches --- (dropping Ingo from cc's) On Thu, 2015-04-16 at 23:59 -0400, Sasha Levin wrote: > On 04/16/2015 11:21 PM, Steven Rostedt wrote: > > I have no idea what event caused the issue :-/ > 4.9.2+ is needed for KASan. Perhaps the documentation and Kconfig entries could describe that a bit better. Documentation/kasan.txt | 6 +++--- lib/Kconfig.kasan | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/kasan.txt b/Documentation/kasan.txt index 092fc10..3038b4b 100644 --- a/Documentation/kasan.txt +++ b/Documentation/kasan.txt @@ -9,7 +9,7 @@ a fast and comprehensive solution for finding use-after-free and out-of-bounds bugs. KASan uses compile-time instrumentation for checking every memory access, -therefore you will need a certain version of GCC > 4.9.2 +therefore you will need a gcc version of 4.9.2 or later. Currently KASan is supported only for x86_64 architecture and requires that the kernel be built with the SLUB allocator. @@ -23,8 +23,8 @@ To enable KASAN configure kernel with: and choose between CONFIG_KASAN_OUTLINE and CONFIG_KASAN_INLINE. Outline/inline is compiler instrumentation types. The former produces smaller binary the -latter is 1.1 - 2 times faster. Inline instrumentation requires GCC 5.0 or -latter. +latter is 1.1 - 2 times faster. Inline instrumentation requires a gcc version +of 5.0 or later. Currently KASAN works only with the SLUB memory allocator. For better bug detection and nicer report, enable CONFIG_STACKTRACE and put diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 4fecaedc..1e1c23e 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -10,8 +10,9 @@ config KASAN help Enables kernel address sanitizer - runtime memory debugger, designed to find out-of-bounds accesses and use-after-free bugs. - This is strictly debugging feature. It consumes about 1/8 - of available memory and brings about ~x3 performance slowdown. + This is strictly a debugging feature and it requires a gcc version + of 4.9.2 or later. It consumes about 1/8 of available memory and + brings about ~x3 performance slowdown. For better error detection enable CONFIG_STACKTRACE, and add slub_debug=U to boot cmdline. @@ -40,6 +41,7 @@ config KASAN_INLINE memory accesses. This is faster than outline (in some workloads it gives about x2 boost over outline instrumentation), but make kernel's .text size much bigger. + This requires a gcc version of 5.0 or later. endchoice