Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp946727ybm; Wed, 27 May 2020 11:52:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv4U2ch24G1UiM5mlI0lSmscrOTTyoxNgZTvlWUAjT202AcNug8QkgvkoyouiSIaF78h4Z X-Received: by 2002:a17:906:2dc8:: with SMTP id h8mr7653192eji.108.1590605578471; Wed, 27 May 2020 11:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590605578; cv=none; d=google.com; s=arc-20160816; b=SD0Kt2Ilsi5DXm/yK906oma93/0UwCwH01LcWDG16D6ACwLbwUmbs884EWdmRi6M6A ZrpCnDyp2pJnLl8ywK1bTATHUErjfMD1f3E3m0fupb6uweBDsk3/Acfn3mhSmK0E7X4B CLAnpNPGL5X2EbB0giM+z3xX/YfqWXyrpPmSfOURu9ysJwH45bxv0ESOi0kuhK+tfaA/ qw9qebOls7hDek5k9UdA0x4rn55cvrsZ7Ir+QCjTnBbXnFknGMbI+giKAgPK+BbRjcoj Jcs9T9uXi/k2d6d2SYzWk+77YnQJuxUbyIGwgrB2BI7plylusXIwg4PQyTbrWRtzLYVn NXIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=i7E6r4O9SxRdi44Ehy54vcdVS79hRFjoVmMHi+meKsU=; b=gfGphN8qBJa5FIJPYUO85Q7XaOJ+BM7wfFiJ8vVzMD6iSnKDOAk+MqZzMmV/Rf94Be ZKjDj95DcOGqRfnLVx/EY8VAmcNsXE/bwmRrtjTLWRL5VJ4MaVcHZm4U/bZOJnvxE7bo KZb/urn5x45ubOD2YYAaAf5kiPHpAyDM6QAKfa5sqIzW4T73m/Thbwk0HOVONWUCy9bd bX2UpnUEDbV94pUTSlz3zItZviv10XgAKAFvKkygZ2BY0sSXbg9yjiKJ278U8zTTaWKy /EmaUhm3YCDuDOdO7D8h3oTeoBm1spDNkOK72JD7RwYuydAgX+qCuWy3LR9hLI410SfF cb4w== 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 y21si2272226edt.501.2020.05.27.11.52.34; Wed, 27 May 2020 11:52:58 -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 S1729878AbgE0PYL (ORCPT + 98 others); Wed, 27 May 2020 11:24:11 -0400 Received: from foss.arm.com ([217.140.110.172]:39994 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725971AbgE0PYL (ORCPT ); Wed, 27 May 2020 11:24:11 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C3DDD30E; Wed, 27 May 2020 08:24:10 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.7.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 01D3E3F52E; Wed, 27 May 2020 08:24:08 -0700 (PDT) Date: Wed, 27 May 2020 16:24:06 +0100 From: Mark Rutland To: Arnd Bergmann , Nick Desaulniers , Fangrui Song Cc: Catalin Marinas , Will Deacon , Sami Tolvanen , Kees Cook , clang-built-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: disable -fsanitize=shadow-call-stack for big-endian Message-ID: <20200527152406.GD59947@C02TD0UTHF1T.local> References: <20200527134016.753354-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200527134016.753354-1-arnd@arndb.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 03:39:46PM +0200, Arnd Bergmann wrote: > 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 I suspect this is similar to the patchable-function-entry issue, and this is an oversight that we'd rather fix toolchain side. Nick, Fangrui, thoughts? Mark. > --- > 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 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel