Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1048482ybm; Wed, 27 May 2020 14:53:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd6r9cGnqI/nHHzAoV6Y7vO4NWmxoIGRSaIqzO0B/AHBJUffbESb6KNd3czKAhBviIZ1xP X-Received: by 2002:a17:906:355b:: with SMTP id s27mr335067eja.436.1590616393394; Wed, 27 May 2020 14:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590616393; cv=none; d=google.com; s=arc-20160816; b=OyXId4MyvWmc4EzC2fXpI/7bMbiI0m/t3zSLFVWaGPtww3CvWzXtznQCy3Gc8/Xua7 1qmEnacO1va4lT6ePvPb6+jnNZeZMG5U7/ful4sHJ94E9/N4x7R+4iDHsiLZq2V/fv9H Fib1ToV1AkBpWQ9+xgVbif8ykEIIOSYF+LRzokKLpKG9KqaEV+/scu8Kz8roYGkMRizY k9Fj2/s8P7wz/SlvylHiZR11qcCNusn0Bzcu1y+1Qih4weExdfhjcpelndy0gHhA4cXR T1GERABXrC5EoxcrIsTPRtnPDmkpP22wf1veCA0hQr1E0JFLW0niCH/82l5ReSkjjJSJ mTQQ== 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 :dkim-signature; bh=Ac0TzlNqiL+rdZbCAWc33T2M+dlFeVr61CWdwcJ9jPo=; b=QXlscLmZgAdKl+1sbS7N7Sx8IJ4hjDex8LmO78GMoJ3ThqKMhtkXTSiQbgkt8s/M7H KM5gNixg/kdX2wOJS1qmMQ+65H7OzWdO/STlrLCeyLzKa7CrNrxmpTfniebIrwLm4h/l 54HC/rsnAbrLgoey7lTctcGw5Q8I1F1odVAUfGpM1XDfuBcp8U8xLUnJc9e9XC6G5sA+ dqtn0RMGYdBivIdqJ78AphwpR4aZ1xQnGZYjzNoBR8P+kiBETFm6tfjz2pRXpuR3EZfS 1a69s842aBTUIAdYRHRsKabL+VYZfodX1wzqvnEfitvgyPBBW67o8gft6sZwxUwQAbLj AvZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ntJ5XnpR; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si2630521ejm.8.2020.05.27.14.52.48; Wed, 27 May 2020 14:53:13 -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=@google.com header.s=20161025 header.b=ntJ5XnpR; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728326AbgE0Swi (ORCPT + 99 others); Wed, 27 May 2020 14:52:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbgE0Swg (ORCPT ); Wed, 27 May 2020 14:52:36 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CD2BC08C5CB for ; Wed, 27 May 2020 11:35:23 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id x10so10488162plr.4 for ; Wed, 27 May 2020 11:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ac0TzlNqiL+rdZbCAWc33T2M+dlFeVr61CWdwcJ9jPo=; b=ntJ5XnpRsas3+IMRMkXV9mcg+6CdbP5T94nDFftj+4ije7j9kUpq40mpLekWlH7lmr v0pHPz+h4ZJ7MURzp29LzyPdWpK5hvGFFrBNYkiLR2zpYFkIujD8VfGPfd9EJGJ2RiAH eiao4XAVqkbAGxBNqSzZR1BCJagtyVTbzHtnr0RV4y7OVFWJldtsbvj7jS7UOzmirJZn 8e7c+7y5Dhl9SfuiIxQ+P8quG5KWv6kvHbdpOAf0VGiFlJ1LRg7eUEoXw1khaFbWaOe9 8mScLq9mra70QUndy0nnxLX5YfwM0TLoSw3U+yyrLPCguSLnac8d3Q4jnxB/MV1JBzS1 LPkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ac0TzlNqiL+rdZbCAWc33T2M+dlFeVr61CWdwcJ9jPo=; b=UzSP0Om4kDaoypqPXAMwBHGhlC2YlLsha/7PVrLaIvCOsyBrtsdpjYGQbDGINIxnVO xkIWZDKF+f7kpK27TWMaaak/cwM2rrXAKMULC6k+GIb0p2RCyvRZcUs5EM6MisowDuI2 AgJGzlFCpFnROsYEfwNIxzAi4ZkX6Y5mqGo8Frg9+/wSIgdt8qgByQzd1QHub6SOdNNs KCOhauPyufXab6ml6JNJq6cGvKMPlv2Z1PhDaC7uYOagpR1sIAmVNJI7B8iRr9GKvVYx h0KukxupJhq3ox7t0guEWrvqnvTP+Do2iglXBlxqVUnd7d42UOfUeWPa7lYLDX+bRzd2 QBpA== X-Gm-Message-State: AOAM532tXqPdgbut4EKT42JekubwuqfQwUVPBIWDbwVKzkWEqvtDDyfR Ky9eGIsGDv75K5n3woG9Atr1RQ== X-Received: by 2002:a17:902:c006:: with SMTP id v6mr6787936plx.53.1590604522433; Wed, 27 May 2020 11:35:22 -0700 (PDT) Received: from google.com ([2620:15c:2ce:0:9efe:9f1:9267:2b27]) by smtp.gmail.com with ESMTPSA id k7sm2497552pga.87.2020.05.27.11.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 11:35:21 -0700 (PDT) Date: Wed, 27 May 2020 11:35:17 -0700 From: Fangrui Song To: Arnd Bergmann Cc: Nick Desaulniers , Mark Rutland , Catalin Marinas , Will Deacon , Sami Tolvanen , Kees Cook , clang-built-linux , Linux ARM , LKML , Tom Stellard Subject: Re: [PATCH] arm64: disable -fsanitize=shadow-call-stack for big-endian Message-ID: <20200527183517.uhph2pvnkyf6c5p7@google.com> References: <20200527134016.753354-1-arnd@arndb.de> <20200527152406.GD59947@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-27, Arnd Bergmann wrote: >On Wed, May 27, 2020 at 7:28 PM 'Nick Desaulniers' via Clang Built >Linux wrote: >> >> On Wed, May 27, 2020 at 8:24 AM Mark Rutland wrote: >> > >> > 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? >> >> Exactly, Fangrui already has a fix: https://reviews.llvm.org/D80647. >> Thanks Fangrui! > >Ok, great! I had opened the bug first so I could reference it in the >commit changelog, it seems the fix came fast than I managed to >send out the kernel workaround. > >Do we still want the kernel workaround anyway to make it work >with older clang versions, or do we expect to fall back to not >use the integrated assembler for the moment? > > Arnd We can condition it on `CLANG_VERSION >= 100001` (assuming Tom (CCed) is happy (and there is still time) cherrying pick the two commits https://bugs.llvm.org/show_bug.cgi?id=46076 to clang 10.0.1)