Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp322306imp; Thu, 21 Feb 2019 02:06:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IaPdLvH1hy2W5xRICWM9cSrYI4AinHcy+VFU+9joOzLgPElWMgk0xtogimZQth6ue51qhnU X-Received: by 2002:a65:620a:: with SMTP id d10mr32818502pgv.75.1550743605397; Thu, 21 Feb 2019 02:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550743605; cv=none; d=google.com; s=arc-20160816; b=JEZGBaceG1OwAKhdRskKR7h617Hw42ttqmwFD0XxtKjDGuop/Q0YRBwt0DMIV1APHe o9C5cQJ6tgmyo7JCQr32ZWOpUBHuPap8BcOl3tRkptC0tLkQ2D3grkTLQ4QCpBw16HpR FjOqKqyztYYI/JDDNhurXvMFvO85zc1HQw2t4aOic5tYSRXsbV3qaLE2X416hqA+Uiiu GARXxKS37HbtINaIhGr2oR30BnMSDb6Pl9uOwtCa6+8BKEgwBXlnvrMMHW0LW857a8+K SLNfQ0a5+DTGSmpxmgYfwdg/jWBXwRvNDdsrMNLVGUZoTgsDu8+cWFpkXGOVPcJ4yis/ jdKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=clJo/KHaB4/92795HYXz0ccHoaodu3dUNpJTJTLBI+Q=; b=In7xIy2lqzFs4jSiWOnyheIgynDmDbX95P+a59ri7+ILD88QyJ+uY6ap6INyb88rvm QBjd/1+1tK4x6v3m49gCU2hr8EmUASoAs89mtR5dvyh2i9nLmnjwa6bN2Ye80AlKF6BC q5i2ivtjMVmvc13Sk3A4rqiv0egrNuGBRxm20o1TgVzI7zmtIVhI9JVxR+DjZA5azULa k+hPUUaFnqBFylh1iJxCGgAtNCNG080v5VJ6sMEbBedXU9tn0k03nBUZAKDqob6Ir7wx 1HKwCQuPPAG3gVNiDR4FqrAR2iuRLLPNSuRo9d8IILa3kybVYhtV2NyyyugUbbv406Wf 6Xfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24si20598726pgj.582.2019.02.21.02.06.29; Thu, 21 Feb 2019 02:06:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbfBUKGI (ORCPT + 99 others); Thu, 21 Feb 2019 05:06:08 -0500 Received: from relay.sw.ru ([185.231.240.75]:49990 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbfBUKGH (ORCPT ); Thu, 21 Feb 2019 05:06:07 -0500 Received: from [172.16.25.12] by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gwlEu-0007TL-Ng; Thu, 21 Feb 2019 13:06:00 +0300 Subject: Re: [PATCH] kasan: turn off asan-stack for clang-8 and earlier To: Arnd Bergmann Cc: Andrey Konovalov , Masahiro Yamada , Michal Marek , Andrew Morton , Dmitry Vyukov , Nick Desaulniers , Mark Brown , Qian Cai , Alexander Potapenko , Martin Schwidefsky , Christoph Lameter , LKML , Linux Kbuild mailing list , kasan-dev References: <20190219214940.391081-1-arnd@arndb.de> From: Andrey Ryabinin Message-ID: Date: Thu, 21 Feb 2019 13:06:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/20/19 8:35 PM, Arnd Bergmann wrote: > On Wed, Feb 20, 2019 at 6:00 PM Andrey Ryabinin wrote: >> On 2/20/19 5:51 PM, Arnd Bergmann wrote: >>> On Wed, Feb 20, 2019 at 3:45 PM Andrey Konovalov wrote: >>> I would have to some more research, but I expect several hundred >>> patches before we get to a clean randconfig build with a broken >>> compiler. >> >> Manually maintaining asan-stack parameter for the sake of one broken compiler isn't a great idea either. >> >> Couple alternative suggestions: >> >> 1) If we can't fix the problem or the cost of fixing is too high, maybe just hide it? Disable -Wframe-larger-then on pre clang-9 compilers. >> >> 2) Fallback cflags. The idea is to try to compile every the file with "-mllvm -asan-stack=1 -Wframe-larger-than=2048 -Werror" at first, >> and fallback to "-mllvm -asan-stack=0" if failed. So it would be something similar to $(call cc-option, -mllvm -asan-stack=1 -Wframe-larger-than=2048 -Werror, -mllvm -asan-stack=0) >> except that "cc-option" tries options only once on some code example while we need to try options on every file that we actually compile. >> Honestly, I'm not sure that it's worthy to hack Kbuild engine for that particular use-case. > > My original plan was to put this under CONFIG_KASAN_EXTRA to allow you > to still enable it in older compilers, but you just removed that option ;-) > > Maybe bringing it back would be a compromise? That way it's hidden from > all the build testing bots (because of the !CONFIG_COMPILE_TEST dependency), > but anyone who really wants it can still have the option, and set > CONFIG_FRAME_WARN > to whichever value they like. > I think there is much simpler solution: --- lib/Kconfig.kasan | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 219cddc913ac..6cd035f06cee 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -105,6 +105,8 @@ endchoice config KASAN_STACK int + range 0 1 + prompt "Enable stack instrumentation (unsafe)" if CC_IS_CLANG && (CLANG_VERSION < 90000) default 0 if CC_IS_CLANG && (CLANG_VERSION < 90000) default 1 help -- AFAIK, randconfig is not able to randomize int config options, so it will be disabled for build robots, but users still will be able to enable it.