Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1049692ybm; Wed, 27 May 2020 14:55:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWiOKa3jKmcuobjDW8fhGDU6m2S3rlVDUNaDfN5srw9EGoeETJppm8/ZuZ6urcu9zHYh7h X-Received: by 2002:a17:906:16d3:: with SMTP id t19mr366517ejd.36.1590616412527; Wed, 27 May 2020 14:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590616412; cv=none; d=google.com; s=arc-20160816; b=QOcVFhJbRExDX9eHouKW8fA5r/Bg29us1Ak1E3fmFGp92ohAEsuG1FiFDxvl8149GX mdlM7UazFG5+xWhQaFXVFA7vkFyJIQIu+3+cijmiLYiomI8OEl4fmGWh/pMBUHAbq5XQ g5lPyBk2AWWMrcZVPTiOGuWAXm1kN6cX6fZFjWUAICo7iWp/ofMQbAaDdOMqMoWRBlc1 FIbXxtDeZtKer/Ujgl2Jw/2SVD/arg532qUz0KyE3IKPrJQkcVLSDWqeAB59x61T7MfX bYnuRWDyfgy2JOeG0o4kOhFulRR82a/E02Q5TGSRbRZ50qQIRb3Kvn4fuz4wpAyIGRYr rhsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=GxKtSoP7wvPBHYaceKHyYb7r9pEABCsLT4axduYVU7s=; b=pmdcSe0tF9PtHvSyyEUy480qC7511M1kz7LbttZH9oxM8qiwGw9/Y72IOW8OSUm2jI 1OJ9GBJSrE0oYIKxDpy2I05RIO/go5/ibBtZOxy6X+iWEI08MjNAo7XMkHXBe4g1gKkw wRANVGsKOiz6Ec+VmbAKg/xqB0GXQt3eil1c1PoOMQhwaXTIBbk/nTjK8C9QDcYLi9BM +HLfQTa2JDuuZJeSZLilPPhA8Ftg5D53NMq4TIlz2qQzhVZ4q9XuEMEhCkIXzLtO7Nh1 wbpqaaej2CsoQV+RUVSXowCgecnx0LVlA+rYRsYITmwFwXQBOn5XRJ9lromIr037kRIr MxVg== 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 di26si2392062edb.242.2020.05.27.14.53.09; Wed, 27 May 2020 14:53:32 -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 S1728708AbgE0TCG (ORCPT + 99 others); Wed, 27 May 2020 15:02:06 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:50001 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbgE0TCG (ORCPT ); Wed, 27 May 2020 15:02:06 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MIKs0-1jq4X13IGa-00ENRg for ; Wed, 27 May 2020 21:02:03 +0200 Received: by mail-qk1-f170.google.com with SMTP id c185so603004qke.7 for ; Wed, 27 May 2020 12:02:03 -0700 (PDT) X-Gm-Message-State: AOAM532sB6/jeilJxtLLBEaXpr2jz6ByCtGym3NGq0T2o9bnmBdLUCjB rZmdLn3Q+za9YUJZ+u4HBombIWwOk2MbLUYr+jg= X-Received: by 2002:a37:554:: with SMTP id 81mr1438379qkf.394.1590606122697; Wed, 27 May 2020 12:02:02 -0700 (PDT) MIME-Version: 1.0 References: <20200527134016.753354-1-arnd@arndb.de> <20200527152406.GD59947@C02TD0UTHF1T.local> <20200527183517.uhph2pvnkyf6c5p7@google.com> In-Reply-To: <20200527183517.uhph2pvnkyf6c5p7@google.com> From: Arnd Bergmann Date: Wed, 27 May 2020 21:01:45 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: disable -fsanitize=shadow-call-stack for big-endian To: Fangrui Song Cc: Nick Desaulniers , Mark Rutland , Catalin Marinas , Will Deacon , Sami Tolvanen , Kees Cook , clang-built-linux , Linux ARM , LKML , Tom Stellard Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:qfCIxHU4xtkU6kYOiO4WR3efKPvSdChPUMWYT7MQfvzYolSB8jv Y5gF1HOmqT2scxeMbIzA5JukozrBXoFJgAqlO84UZp+DtqzCvYPdCV1lkRltI+kw6v9GcwH QrvuoHu9Td6sAzn2vyhLYl/CtMaZZx5ZZe71chLDRJNhtRulH+7Wpfnb6V0B0sSwYV3zBif 8E/t/izOcWLtS7O/OpuOA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:kxf/pA2iKbg=:YMVjswfl+2uwSk9O8I7tAu E6m5LCqOZ0hzeuWYt9NjZnfQ7NFyQZbmXcirP/Elq7O7vyEo7p1P6vfWAbW7+MERVTkIWXYO3 jsRQ7hqCdKNgCv27/3hlqtl0PJfJ+wSDLDugVln4xwaptUJcc4BEPNqeoU74oZ1Re5JAyLj4c HcIMqu4mqwvOVuGKFCS0xTtQuSCXxghhY/DrZdMOd6Lw3LmLxN7Tmiu0Sh3ULI8hsk/6oOjQq 1Y0lZTvO2hhesoWxmp+M4mTvPMFgFNru5yMp7y6xfMAX86hfy2u74rjrpC/BHnV61Tg1fi8Lh FkJpg7bU6keabe5T0QruI8xe2huiD74G4PqDVoR0fkq7xFDFtMF82x35fxTGRjp3nOlVIk5ce KrSHnHiKYFGm1ra4zQj3eAmlDI6SHLjvdqLuMm6pBP9tmXtBBnQ0jnM4A68lwtq5l3LH+Zwp0 d1ETm/2jLP3bKsplX4mO1VIka1RqalNxvmwWz0L7fjaTf2qn1t8Wt9jPiH/m8Omwzo/gQnIqJ I9FzRvC2HbVPld7w4kcQVwsNmZEqspSHeGlrOoLerkn/pXXfq3iuhnUv7JGoSjrAyVUzTs/so 1N+cD3i/g64jn2B1HYceLfzOr1k+nwZXvqAz8R5H6SEznUZ9C4oydOTCoYuq7BDX4MoJN1nba rd4Pw9P/19RzstcsWUYH8V2Orfm9mMZHcUSf8PSE38Q7tXRuHrEFUizA3WchvPyZY+rWU9UF3 A6ihFz+im+YIdVCM+RemxJ4vXPS4lo0VVtJP1iLqqlnogQTKxZcBwXu9dhNDhUhjN16627eCJ Jmn3zqNhLtky999MOq8LKmm6hsaLpW2IMah1/AIbQhu5FxdsFg= 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 8:35 PM 'Fangrui Song' via Clang Built Linux wrote: > 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? > > 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) Good idea. I assume we will keep requiring fairly recent clang versions for a while now, so chances are that 10.1 or 11.0 becomes the minimum supported version not too far in the future and then the workaround can be dropped again. Arnd