From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A207CC433E0 for ; Wed, 27 May 2020 18:52:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 826D32073B for ; Wed, 27 May 2020 18:52:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728226AbgE0SwQ (ORCPT ); Wed, 27 May 2020 14:52:16 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:44705 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbgE0SwO (ORCPT ); Wed, 27 May 2020 14:52:14 -0400 Received: from mail-qt1-f172.google.com ([209.85.160.172]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MybX9-1ioW4D3EiL-00z0ao for ; Wed, 27 May 2020 20:28:24 +0200 Received: by mail-qt1-f172.google.com with SMTP id a23so20059216qto.1 for ; Wed, 27 May 2020 11:28:24 -0700 (PDT) X-Gm-Message-State: AOAM532ElrXGMnOvToqFtg9QDFRhp2IH/Aw90UwD4neOfiZUnVOUunr/ kqKPP4ucMvjN+dP/ZcvUxfcw5WS8c1Zj2PPw5yY= X-Google-Smtp-Source: ABdhPJzQFIUHW/JF3c0VCZnhiM4CA4LQ8k4vA7NOeogILSh6rHeZtA5TuSpUsKWWob7tJdlDv6coQztfVWvYPA3oB/s= X-Received: by 2002:ac8:1844:: with SMTP id n4mr5557996qtk.142.1590604103622; Wed, 27 May 2020 11:28:23 -0700 (PDT) MIME-Version: 1.0 References: <20200527134016.753354-1-arnd@arndb.de> <20200527152406.GD59947@C02TD0UTHF1T.local> In-Reply-To: From: Arnd Bergmann Date: Wed, 27 May 2020 20:28:07 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: disable -fsanitize=shadow-call-stack for big-endian To: Nick Desaulniers Cc: Mark Rutland , Fangrui Song , Catalin Marinas , Will Deacon , Sami Tolvanen , Kees Cook , clang-built-linux , Linux ARM , LKML Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:AAs3BLls+YSdR1xFKiw97CMcig+gAVZJsoMLAefqQ52Ob22UL43 eaCJPpfSOF5SgItYD9FnjFxFAFSl1z8E9cd1dEycQpOp9sg3q5RzJkkAxc4Ba+OqM35074d ri6aRCYL6QuOAn/k/OiD+oiXYiKX/X2rblFDd3kVLokcoT+OKb8B7nw7fpCo4gGHYHI5pB4 1mDlOW9JpWe2RhY6mrDPQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:UIrWExRtcrs=:YjImiCCLj5aKp9nTRIA67t gHFr2K0bfKkUKvieZpHMM55dGkl4spbMf4FqzIgp5kyh/CPwbUUXla0ppGBPoPZ0VUiQsZrOG /FDM4fHS81ySOsMXDZYo8UEdHKMKAcrR0yQFOizCf59ycplXnCbcp5xgV7xUMjMm0hsPhRlLI B7ReEn30Q7+1J13bKCHXikqZFUPUyvBODVecRBl3bmSwAZMz7BewjuORC8/jQcN4BaqAQLi7U xVMlHDVzG2hIFVGoi1/VgBUhU7lpIKFv23RerAakJUYFVUbvlCYzquSdnJt1+l900gwgRqg/E 4YxbvBxwacEMODIvMc94fl9KsoBo9Aiw93wuPotIckaTVPX1XeTgrQXh7QGqzlNLMMvveBLBi Dew3JJsYKPjt9cQ1tr/2L7evFCcpuJvZPjuP6zNaGwt+qSuguDqIoBPifG4XIk/Uv29fDbHYj 4I1Q1ZyZqa+q1o1HiupJSjmIKy+3SQ2etd9zSsQU9BZaO+0NMZx+MiKNxtkPumObRapeg2yKL XS1u30n6kLgizzCdE5bCCNNiHa0bErKYcvLW7OiqL9dshw/AmpmLjsUKnIv8OJuO3Y9wP44bp kAhKp0aK2VdJRKWTsqQe94gfnaFes6mxgj/0UE6MeU2NVUop/O0M5dG3aAYKX0GWClN16MwVn beSKfj35pYqI8UQW6XCujhJ/yAaAIdAzaDn1VD6w5PLxZ6+cqX0I1POf20wDaNbWpRPeyy0Om RfbbXFE27cUxoL3s/1YDR30PgoJrAAxXYtx/Ua/0VKjI1WqZLgC6Yu6zIkNEwHVHayMHcFzkn wU8q1hMvMtjZNsEOkNpzar+uYLsLirexG2MQtV4W9bKbRSLuYM= 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25BDAC433E0 for ; Wed, 27 May 2020 18:36:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA93620835 for ; Wed, 27 May 2020 18:36:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IhTM8gNs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA93620835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sS6GR/jil3+htjC3bNrkzKzwAmqMn86k1KgT/YH+BEM=; b=IhTM8gNsh7t3OG nvMUpAyyLhN1zek1lNeQe97cXxiSAGZS0H3YFfIh5784rVUaqdsb+UTgMkivTp+J+j9UV9ETA3nb9 ddPGYvp+yJb/x3wP2ugWvLzkk8icjYp1lQeXISocBgHsVdcdK5AP2aUsyndMNKZS1hFnRwG9mHn8o HKRlmrypZGYi9N7GKZunrYEWMxC5c0PvTwKiYzv85E14gGe2DG/Ap2rN/fuYaba2+IHXEy+/ECerB nIwbWSzsP/GwdX7Z4Dqgjr+/NNhfg8xh9HKa4foaKNT9TcXGepo28motLAA+PUIjLkv/aDNsQR6TD QKKHyEWb+FxiSVbDT/sQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1je0ui-0001lI-AY; Wed, 27 May 2020 18:36:28 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1je0ue-0001kf-S3 for linux-arm-kernel@lists.infradead.org; Wed, 27 May 2020 18:36:26 +0000 Received: from mail-qt1-f170.google.com ([209.85.160.170]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MJVY8-1jKICi3ppw-00Jtq4 for ; Wed, 27 May 2020 20:36:21 +0200 Received: by mail-qt1-f170.google.com with SMTP id e16so14173689qtg.0 for ; Wed, 27 May 2020 11:36:20 -0700 (PDT) X-Gm-Message-State: AOAM533bcGhFlX2xRXfcDzdg9jEZN/gie3w8oIzjSUPeX+qctVRwZJwB Wxg809Uu0IFFsKU5RH2yXi03Ic+ooRYls9mGcsE= X-Google-Smtp-Source: ABdhPJzQFIUHW/JF3c0VCZnhiM4CA4LQ8k4vA7NOeogILSh6rHeZtA5TuSpUsKWWob7tJdlDv6coQztfVWvYPA3oB/s= X-Received: by 2002:ac8:1844:: with SMTP id n4mr5557996qtk.142.1590604103622; Wed, 27 May 2020 11:28:23 -0700 (PDT) MIME-Version: 1.0 References: <20200527134016.753354-1-arnd@arndb.de> <20200527152406.GD59947@C02TD0UTHF1T.local> In-Reply-To: From: Arnd Bergmann Date: Wed, 27 May 2020 20:28:07 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: disable -fsanitize=shadow-call-stack for big-endian To: Nick Desaulniers X-Provags-ID: V03:K1:E0FpMC4VW9XneYYzQQReh9kiMFVswFgRTzrPVZZlQLp0j9Xka7a Dm7p/X9+Wq4+bFZASaaGHdVIRixCRIEUQsmMCgu149Yu0LjgpKRlcr1QBZDZXDO2xn+sUtQ Dcr7J5MttRVkE82PfCw4+13fCA7178NDWnHrvvxxny8euzoWGDD6F76BkSM55BfWqt25M+m xy7zuMtm2yEa9TzxuHU1g== X-UI-Out-Filterresults: notjunk:1;V03:K0:SRV9Aj4GGU0=:RSyEPJj8kNOW9rZ6Ax9b/2 ase2cMsGn9wIfV1+jOTvju5JJCuCjA5WOB8pPA003QzSP/ivkyB+FsuWGTCa8A4tPrJLS8VF1 Hn0DjBuseGLqwmitAmlX9hsbma6IcL8Klr93LX/ceqn7Am8fhRIZniWhM4zGhLugtL7+f4jjb 6b0j/P9CONiqG+PopvhmShRQPaTJUuf1/6mBT4GtbBjy+Pmm5zGUF9PQKd++FilQVYM+sN1+l /fIGt78qZTTzzURK7zUp8Qnfl425DJB3jr9Hp8NDpxOvIRVBSdM+nWK/cfcDwpqE3Pww1Wd/r QPJ6Go2FgfS+nILlttFPsYfNoR8HGWaiITQxFacyP/3NN640iHAUAJhsyzsD2STFX5E1liff3 8nn5fzcalY4oTud4NAdPigbaMJ7IehO8BqD39ZsP8cYUtV6EZ+V0rYB6DLY9iWzqrjCVOEKd9 PF7d0F8zpo1OloxT+GKaOgfxng7KPOyATz4Ngzy9SEe50DjW9zWCChNExjqpekzC4cKpAwPcp SvpMTBXxBjLI+KIpbvWyb3hS2r1aFzc7oTgroqwpkH4Gl3YDJ4KOe/7QuOapTIcJ+sAiqaMNO Wix139qQSLyThUZycB8IYSFzbctQAgbXYSuezQfB5JMS0+CK/1lYTAr9+FEtpexCb5IBNUvnS SnVBThhb2e15stHHApMCPDFQv6nwaR6CSOJ3/xN0vF0eCbkWgTlVDE7vAj7lV7EAEMTNheNag LznpwFbjhNNVVp6WaIi9MsDYCj6fT6maPrWYKWbnRqIyYBvJrjwQduG32+7XyWbujll0VBJRg BwdrvHRsrwP2/PvrAL/3j+BuJp0/yRx93HTnkKi4TyL+dptlR0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200527_113625_205896_ED2BEE6A X-CRM114-Status: GOOD ( 20.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kees Cook , Fangrui Song , Catalin Marinas , LKML , clang-built-linux , Sami Tolvanen , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel