From patchwork Thu Dec 15 21:32:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 9476971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 19239607EE for ; Thu, 15 Dec 2016 21:33:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F232A1FFD7 for ; Thu, 15 Dec 2016 21:33:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E479228856; Thu, 15 Dec 2016 21:33:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDDB41FFD7 for ; Thu, 15 Dec 2016 21:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755147AbcLOVdt (ORCPT ); Thu, 15 Dec 2016 16:33:49 -0500 Received: from merlin.infradead.org ([205.233.59.134]:44690 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754504AbcLOVdn (ORCPT ); Thu, 15 Dec 2016 16:33:43 -0500 Received: from static-50-53-43-78.bvtn.or.frontiernet.net ([50.53.43.78] helo=[192.168.1.19]) by merlin.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1cHde7-0007Bs-SO; Thu, 15 Dec 2016 21:33:00 +0000 Subject: Re: default 0 if KASAN expression not working in kbuild To: Nikolay Borisov , linux-kbuild@vger.kernel.org References: From: Randy Dunlap Cc: LKML , yann.morin.1998@free.fr, mmarek@suse.com Message-ID: <18825051-61d0-e8a9-544a-4f7d89f30b3c@infradead.org> Date: Thu, 15 Dec 2016 13:32:58 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 12/15/16 10:09, Nikolay Borisov wrote: > Hello, > > I was doing some kasan-related debugging and when I enabled it I started > getting warnings for large stackframes. So CONFIG_FRAME_WARN has : > > int "Warn for stack frames larger than (needs gcc 4.4)" > range 0 8192 > default 0 if KASAN > default 2048 if GCC_PLUGIN_LATENT_ENTROPY > default 1024 if !64BIT > default 2048 if 64BIT > > This means that frame_warns should effectively be disabled when kasan is > enabled. However in my case this is not the situation. > http://sprunge.us/FiGf here is the config file. It does have > CONFIG_KASAN=y and CONFIG_FRAME_WARN=1024 . And even this is erroneous > since it's a 64bit kernel, so it should be 2k. I haven't manually set > the limit to 1k either. Yeah, it set FRAME_WARN=1024 for me also. It seems to be dependent on order of kconfig symbols in lib/Kconfig.debug. If I move the line: source "lib/Kconfig.kasan" to just after this line: menu "Compile-time checks and compiler options" it seems to work for me. Can you test the patch below? --- lnx-49.orig/lib/Kconfig.debug +++ lnx-49/lib/Kconfig.debug @@ -117,6 +117,8 @@ endmenu # "printk and dmesg options" menu "Compile-time checks and compiler options" +source "lib/Kconfig.kasan" + config DEBUG_INFO bool "Compile the kernel with debug info" depends on DEBUG_KERNEL && !COMPILE_TEST @@ -695,8 +697,6 @@ config DEBUG_STACKOVERFLOW source "lib/Kconfig.kmemcheck" -source "lib/Kconfig.kasan" - endmenu # "Memory Debugging" config ARCH_HAS_KCOV