From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: Re: [PATCH v4 05/17] ctype: Work around Clang -mbranch-protection=none bug Date: Mon, 29 Jun 2020 11:37:16 -0700 Message-ID: <202006291136.E6DF8242@keescook> References: <20200629061840.4065483-1-keescook@chromium.org> <20200629061840.4065483-6-keescook@chromium.org> <202006290806.3BDE2A8@keescook> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729138AbgF2Smw (ORCPT ); Mon, 29 Jun 2020 14:42:52 -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 5BDBEC033C3C for ; Mon, 29 Jun 2020 11:37:18 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id d10so7429368pls.5 for ; Mon, 29 Jun 2020 11:37:18 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Nick Desaulniers Cc: Ard Biesheuvel , Will Deacon , Dave Martin , clang-built-linux , Catalin Marinas , Mark Rutland , Peter Collingbourne , James Morse , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nathan Chancellor , Arnd Bergmann , X86 ML , linux-arch , linux-efi , Linux ARM On Mon, Jun 29, 2020 at 11:02:51AM -0700, Nick Desaulniers wrote: > This is definitely better than the empty function. Though a patch is > posted for fixing this in LLVM. Assuming that lands before this, we > might not actually need this workaround? > > arch/arm64/Kconfig > 1625 config ARM64_BTI_KERNEL > ... > 1633 # https://reviews.llvm.org/rGb8ae3fdfa579dbf366b1bb1cbfdbf8c51db7fa55 > 1634 depends on !CC_IS_CLANG || CLANG_VERSION >= 100001 > > So if Daniel's patch lands AND is backported into the clang 10.0.1 > release, then we might not need to carry this workaround? Either way, True, though as I mentioned in the review, I don't think it's quite right -- the warning getting removed is actually quite valuable. > Reviewed-by: Nick Desaulniers Thanks! -- Kees Cook From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729138AbgF2Smw (ORCPT ); Mon, 29 Jun 2020 14:42:52 -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 5BDBEC033C3C for ; Mon, 29 Jun 2020 11:37:18 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id d10so7429368pls.5 for ; Mon, 29 Jun 2020 11:37:18 -0700 (PDT) Date: Mon, 29 Jun 2020 11:37:16 -0700 From: Kees Cook Subject: Re: [PATCH v4 05/17] ctype: Work around Clang -mbranch-protection=none bug Message-ID: <202006291136.E6DF8242@keescook> References: <20200629061840.4065483-1-keescook@chromium.org> <20200629061840.4065483-6-keescook@chromium.org> <202006290806.3BDE2A8@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Nick Desaulniers Cc: Ard Biesheuvel , Will Deacon , Dave Martin , clang-built-linux , Catalin Marinas , Mark Rutland , Peter Collingbourne , James Morse , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nathan Chancellor , Arnd Bergmann , X86 ML , linux-arch , linux-efi , Linux ARM , Linux Kernel Mailing List , Daniel Kiss Message-ID: <20200629183716.1iXAxw4HPcvdYaX8Gw9yKwGGLS3asaVFATTWLDQYJLs@z> On Mon, Jun 29, 2020 at 11:02:51AM -0700, Nick Desaulniers wrote: > This is definitely better than the empty function. Though a patch is > posted for fixing this in LLVM. Assuming that lands before this, we > might not actually need this workaround? > > arch/arm64/Kconfig > 1625 config ARM64_BTI_KERNEL > ... > 1633 # https://reviews.llvm.org/rGb8ae3fdfa579dbf366b1bb1cbfdbf8c51db7fa55 > 1634 depends on !CC_IS_CLANG || CLANG_VERSION >= 100001 > > So if Daniel's patch lands AND is backported into the clang 10.0.1 > release, then we might not need to carry this workaround? Either way, True, though as I mentioned in the review, I don't think it's quite right -- the warning getting removed is actually quite valuable. > Reviewed-by: Nick Desaulniers Thanks! -- Kees Cook