Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp900522ybm; Wed, 27 May 2020 10:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzm8OTnjlTCzTYWnwpsMnTTQeeJQ13k4yT37WA2mw8IrolBdvOMathaCEC67yuCWtTWBPLL X-Received: by 2002:aa7:cb53:: with SMTP id w19mr6975814edt.328.1590601171090; Wed, 27 May 2020 10:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590601171; cv=none; d=google.com; s=arc-20160816; b=HtWRmn5B/46TWr/jdbzg+SbJL7GSpmKcfT5aO5Go0TczcbuK64Fiq20oShhjLgC5YQ 9o/Z+BarbkEEjVxhuNC55rmJSjSfv3hUPf1E8SvUMPJ1aj6gbo1hn2jCELPaNWelUgK5 NxxPPVwuQjdqdqt552zKyz5DOwRdqJzbRAqs3vXQ68Bxez+GSzPc6OzkEcEdHJZmEp3K JAPOzNPCzKJhgvib8cxu02KkkxP2ye5vqOfr9fFD7xz/9I1Pcu3F4WMFrXTtKlnrf8qG yUZbOqqnuVSSpC7EJy6swQkw8rVXs9IAsMKx7OUiT+hYheWG46CHn5YZu/6WB0mxNsGI XJDg== 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:mime-version :message-id:date:subject:cc:to:from; bh=hrtOMZLV7wq1eM/tmz5NFUBibP9KNPXrZqBCQUSGufo=; b=UashaVx1klYRjkb2PzRbz7zKqjXG8GMoxBqkZXRLpvUire1/GdQLycqfpzUoDrfLB1 jG7D+fHUdkj/YF+N+nRTqRiBp41e+GTPK9muanRi0b9mqhRZXTJSeiU7GANC+i7R2g0c MaIlLv/XlNxFTIr/fNuljtVRNbsWb6egrbCQ+V/f8mAD9MTKbAW7xLvnrA3s0YmfkRhb oEPnwMFkhrCCJULy/U1EjZEIQJCtWAu0vyh+YbOOGmRdmv98nujZdnLc7cUl4OUsXS9I SKreY6RPvWF0b5zsC8ZTFItHozu+kDXse5AR7sQqLL4zUuNZLP/QoCIeCZNtbQtOmc4X ny+g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si2007820edm.63.2020.05.27.10.39.06; Wed, 27 May 2020 10:39:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388385AbgE0Nk2 (ORCPT + 99 others); Wed, 27 May 2020 09:40:28 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:53945 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388098AbgE0Nk1 (ORCPT ); Wed, 27 May 2020 09:40:27 -0400 Received: from localhost.localdomain ([149.172.98.151]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MRTEr-1jPrFs1MOr-00NQt9; Wed, 27 May 2020 15:40:17 +0200 From: Arnd Bergmann To: Catalin Marinas , Will Deacon , Sami Tolvanen , Kees Cook Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] arm64: disable -fsanitize=shadow-call-stack for big-endian Date: Wed, 27 May 2020 15:39:46 +0200 Message-Id: <20200527134016.753354-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:WMyBDjaVpnuIlG/nKy3Lfv0f53mC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Hpy/trLFTR2EQPAPCTZ2pxYPaGA3bxNgm8GAncGv7aa37U1Y= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clang-11 and earlier do not support -fsanitize=shadow-call-stack in combination with -mbig-endian, but the Kconfig check does not pass the endianess flag, so building a big-endian kernel with this fails at build time: clang: error: unsupported option '-fsanitize=shadow-call-stack' for target 'aarch64_be-unknown-linux' Change the Kconfig check to let Kconfig figure this out earlier and prevent the broken configuration. I assume this is a bug in clang that needs to be fixed, but we also have to work around existing releases. Fixes: 5287569a790d ("arm64: Implement Shadow Call Stack") Link: https://bugs.llvm.org/show_bug.cgi?id=46076 Signed-off-by: Arnd Bergmann --- arch/arm64/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a82441d6dc36..692e1575a6c8 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1031,7 +1031,9 @@ config ARCH_ENABLE_SPLIT_PMD_PTLOCK # Supported by clang >= 7.0 config CC_HAVE_SHADOW_CALL_STACK - def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18) + bool + default $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18 -mbig-endian) if CPU_BIG_ENDIAN + default $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18 -mlittle-endian) if !CPU_BIG_ENDIAN config SECCOMP bool "Enable seccomp to safely compute untrusted bytecode" -- 2.26.2