Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp827679pxb; Wed, 22 Sep 2021 13:59:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXZ0NNcP8QtLI4A91hurNKK2ytHGGQc33BGm47njT+xkt6ihD0aoBJt3Os86CzGFk8WpUm X-Received: by 2002:a17:906:6d5a:: with SMTP id a26mr1408295ejt.162.1632344391922; Wed, 22 Sep 2021 13:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632344391; cv=none; d=google.com; s=arc-20160816; b=QxcF0/D273JXYUwCjpV1ISG/vVUvrDqZJqBBYh16ZR/VdM4UilKjAMYyV5UZibgK3G 2jNn/QIDicZfhKfwH1gf3+UUtTZOxzuYWNQBhF4PzTlGHAAt8KpIh7xS0FP59PFy4j1e BMf0ozPHjVuQVt0mbYeXjdmjwZYGallV0N2bvGANgzLuVquDwWSldqAPxGI3u4bEJ1J9 Sust+PbL7/tHvNt7LTBwyktWhYDZVuIrf2GJRyU6rq1e7hX4JVmRLt5ZJQK47X2erYVT ielFD2MZUc64Xu4wztgHBQf9vqawv8e3dPZD6RB56jvvGIGIKXJ1HmMWLcK3JWGbo/Lk HhIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=N5R33lCeEAR23h6ryuDeUX0kwHjUUeOVtRNqvTTh+tQ=; b=C/Gs8CYYCGUcdmxRP1NfVS8QozwVwT+EKWhTKP3XdrrY3Ml/j0pfi6LoqZ5EHxsuIz Z5g8Z8eaJXUqijLEVkdhWdPigcNfcLj/75bNOPoEXuvnVbelt3NBeK0QD3vZJKoXZJy+ rs8Hp9E6G9O8Vw3UniwhbDwL+RPGKUTkw5PdohREiwFga7U3iiVXHBw6x8PcgYr19uNT njhKfSaHa+mze4lgVXxmhaD8T0gZkFwSrAi0TvZlzVlLCKAmaNNsLeP/zZFKqarVBS9V KBfB60/Aj8viqGkiujRzzSbV636XiX6Umrd+epTrXvNwNsiAARaHavyPR1+azOaDrEX4 8B0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JoazlHT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si4027574ejn.348.2021.09.22.13.59.27; Wed, 22 Sep 2021 13:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JoazlHT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237978AbhIVU5h (ORCPT + 99 others); Wed, 22 Sep 2021 16:57:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:56244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238006AbhIVU5J (ORCPT ); Wed, 22 Sep 2021 16:57:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB41261353; Wed, 22 Sep 2021 20:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632344138; bh=M7iLfrDWnvEHZ35K9OsYIwOfFvN+NiWTqgmxlmOCDLY=; h=From:To:Cc:Subject:Date:From; b=JoazlHT/9BFamaVgzKt87cguKza0c1DpbyMR5xYlqaSOs+SWdPDq//TJUOnqg8U3l uR0mXKOrrn61NkOm2qMfwpGQ1698WlmeM2Zt9xzl5wyNFa47OQUgVQTWFtzTdV8zt5 FE6fWGRRGNDpRCKUVRDPe1vRuA0KidDMfp5NEgUmgOxhA73vDtDl9bFo+t8wy2Rrzo YM+d2jFBt+yV1n8e9eaMjGXMBC+1xwjyiiptVXGYRO/6bV6B59C/mkT4djBKMj3Oib HeB7SLC/yIXx2jFkp6bJ6NyLznb6lFl2WTHVOQe57lZEpCohrROhS5Ow0ZM8mqNY0w cX7dZPPDpeq5Q== From: Nathan Chancellor To: Andrey Ryabinin Cc: Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Nick Desaulniers , Arnd Bergmann , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: [PATCH] kasan: Always respect CONFIG_KASAN_STACK Date: Wed, 22 Sep 2021 13:55:25 -0700 Message-Id: <20210922205525.570068-1-nathan@kernel.org> X-Mailer: git-send-email 2.33.0.514.g99c99ed825 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the asan-stack parameter is only passed along if CFLAGS_KASAN_SHADOW is not empty, which requires KASAN_SHADOW_OFFSET to be defined in Kconfig so that the value can be checked. In RISC-V's case, KASAN_SHADOW_OFFSET is not defined in Kconfig, which means that asan-stack does not get disabled with clang even when CONFIG_KASAN_STACK is disabled, resulting in large stack warnings with allmodconfig: drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c:117:12: error: stack frame size (14400) exceeds limit (2048) in function 'lb035q02_connect' [-Werror,-Wframe-larger-than] static int lb035q02_connect(struct omap_dss_device *dssdev) ^ 1 error generated. Ensure that the value of CONFIG_KASAN_STACK is always passed along to the compiler so that these warnings do not happen when CONFIG_KASAN_STACK is disabled. Link: https://github.com/ClangBuiltLinux/linux/issues/1453 References: 6baec880d7a5 ("kasan: turn off asan-stack for clang-8 and earlier") Signed-off-by: Nathan Chancellor --- scripts/Makefile.kasan | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 801c415bac59..b9e94c5e7097 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -33,10 +33,11 @@ else CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ $(call cc-param,asan-globals=1) \ $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ - $(call cc-param,asan-stack=$(stack_enable)) \ $(call cc-param,asan-instrument-allocas=1) endif +CFLAGS_KASAN += $(call cc-param,asan-stack=$(stack_enable)) + endif # CONFIG_KASAN_GENERIC ifdef CONFIG_KASAN_SW_TAGS base-commit: 4057525736b159bd456732d11270af2cc49ec21f -- 2.33.0.514.g99c99ed825