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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 F265AC433E1 for ; Mon, 29 Jun 2020 21:26:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDC92208B6 for ; Mon, 29 Jun 2020 21:26:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Q8HPwYcP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391081AbgF2V0X (ORCPT ); Mon, 29 Jun 2020 17:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729096AbgF2Smr (ORCPT ); Mon, 29 Jun 2020 14:42:47 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E368C033C3E for ; Mon, 29 Jun 2020 11:37:18 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id d6so8388668pjs.3 for ; Mon, 29 Jun 2020 11:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mHYFnEmrPBB0EoPbZgrylZKEYeUJ7dEY2zbQRVE/TE0=; b=Q8HPwYcPpk6cvqNepdjj7GzG1i+hF0OU2K7lY/4cN3hqsYfjspAjYrh+e2x1oQ7izt iGyhkr4NRFSf1YHoPA7GUZuTdUCb2hwxF7gz7vNnMwVjF3WqMxXPlRNOJMDLab1+merl 8ySrtV3vm5xm4BTKo0/QkZC1k/74EuL1hVQtU= 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=mHYFnEmrPBB0EoPbZgrylZKEYeUJ7dEY2zbQRVE/TE0=; b=KvW5uzXjFp+h+ZQIjPu14FhHCVN15rTX9r/Az0LKSuLxBFFnznBXdIwatwaT5e6bHI D5A/K4XxpvRc9suclUjZoJWVNajAZMBC1xdI4PvdNFk5SY6egjglHq1k/CDIZ17mTTVP GOL5q8Hint/Ek+Z71UkKANZFdLAlwEtkeq3Rwc+q0FiH3k53ivIdKwtDo8hlAN7mvOUR iH4KYnDJepPurME6RK9YIDvUbEblOkEO8kfiY5HdFa3ZRic9FsFJPNKePA4ACAZli/UO 2nlk53Um9HcY5V3yemuHdkoI/Zyo1KGvblPpqqLPU/k3orDXOpVQdlEwvAZAwZ2P1Cfk 2qFg== X-Gm-Message-State: AOAM533AYDmMEjJaCUqBlXHeW+VHabM39sDu7oqTKMaPW4QZtl5IySbw xR+OQe0GU2shob1xwArfwza/8A== X-Google-Smtp-Source: ABdhPJyO5LBgTD5AtbVt3yk/cj+JfeKTEZLWvpJPG/3xUjAxL4UTeU1IkJQNAdsLcqAC0lW924PkIQ== X-Received: by 2002:a17:90a:e884:: with SMTP id h4mr9418062pjy.229.1593455837971; Mon, 29 Jun 2020 11:37:17 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n15sm457229pgs.25.2020.06.29.11.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 11:37:17 -0700 (PDT) Date: Mon, 29 Jun 2020 11:37:16 -0700 From: Kees Cook 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 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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: 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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 3FD7CC433E2 for ; Mon, 29 Jun 2020 18:39:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 173E12225F for ; Mon, 29 Jun 2020 18:39:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3ZtvQevt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Q8HPwYcP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 173E12225F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=04oAxP/78u9a5jsa7icxKo2HgmadRwxG0Xiea9jpVV0=; b=3ZtvQevt24m3gHV7kEcRMJH7Y 21oMwlzvvlNSqT3HfJzx65Bfk3VHX7rO587qQWmQi2ej2+ZVTe/8g8Vxx+V/WKfc752oKLuSMgh51 kKaZL45S0RWvTO18GaBsvK7sklYJJuWjctd0aXpbKeC7dR2sntyRZj0hAc7wMQQrCM+j3cl/Kjbxy NpeWk69o6QVt6D2mXwvApetxZQzT11CusBUnyscK167GqNiQCn2WXP/6ME5OsHjeRnMyXjmHEBT7o AYflxPtQaXF42ckcLjNeUcDgR2K50kDhVvTq4SBqLKVfRx5gm5gQduxTRIEsjdUKVuPSoH2QaGH0a hUcU0vnhA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpyeh-00027w-Oi; Mon, 29 Jun 2020 18:37:23 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpyee-00027H-5a for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 18:37:21 +0000 Received: by mail-pj1-x1044.google.com with SMTP id i4so8397156pjd.0 for ; Mon, 29 Jun 2020 11:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mHYFnEmrPBB0EoPbZgrylZKEYeUJ7dEY2zbQRVE/TE0=; b=Q8HPwYcPpk6cvqNepdjj7GzG1i+hF0OU2K7lY/4cN3hqsYfjspAjYrh+e2x1oQ7izt iGyhkr4NRFSf1YHoPA7GUZuTdUCb2hwxF7gz7vNnMwVjF3WqMxXPlRNOJMDLab1+merl 8ySrtV3vm5xm4BTKo0/QkZC1k/74EuL1hVQtU= 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=mHYFnEmrPBB0EoPbZgrylZKEYeUJ7dEY2zbQRVE/TE0=; b=obkgpQLYcRZbzKqFlsDwYscWK3jRdDOBn5ohi97W02gN3FWv2yA4yuHKswDBrukwjV 7zYMDINmU6NKTlTaQtiuQFm8xDJYSAB8EHc9sxZo1XxkC9KJRnH1cSkHW+Yv20pTMQ0v ZQEmv4QDnyKBVcuYR3OPS18fet56iKw5UX3dPxCCHhwWsQ9qniV5viyhlKFNPlTDvxdv Iw3ukyZ04XTZZ4j7mUCYGiUfwx2M5rwS/l86ZXH4E7NgA8F7uE54Zbyd6VJNjrcG4oeG y3PhfGjdhiidZxufEynYZt0WEcsayG38Xt8+qjzZ5Xje2aLUzZD6W6DBL0Ukk91Vj4f0 sKOg== X-Gm-Message-State: AOAM5320G6tnrwyre7JrCXwF/pDZKLiLAd30HdHYgN3CsoxAiIj0LTRJ 148PWlJFUNPfj9pTvaycLsgnGQ== X-Google-Smtp-Source: ABdhPJyO5LBgTD5AtbVt3yk/cj+JfeKTEZLWvpJPG/3xUjAxL4UTeU1IkJQNAdsLcqAC0lW924PkIQ== X-Received: by 2002:a17:90a:e884:: with SMTP id h4mr9418062pjy.229.1593455837971; Mon, 29 Jun 2020 11:37:17 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n15sm457229pgs.25.2020.06.29.11.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 11:37:17 -0700 (PDT) Date: Mon, 29 Jun 2020 11:37:16 -0700 From: Kees Cook To: Nick Desaulniers 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-Disposition: inline In-Reply-To: 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 , linux-efi , Catalin Marinas , Arvind Sankar , Will Deacon , Thomas Gleixner , Daniel Kiss , linux-arch , Masahiro Yamada , X86 ML , Russell King , Ard Biesheuvel , clang-built-linux , Ingo Molnar , Borislav Petkov , Dave Martin , Arnd Bergmann , Nathan Chancellor , Peter Collingbourne , Linux ARM , Linux Kernel Mailing List , James Morse Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel