From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 003EE632 for ; Thu, 5 May 2022 12:36:45 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A7A1F106F; Thu, 5 May 2022 05:36:39 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.29.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 918A43F885; Thu, 5 May 2022 05:36:37 -0700 (PDT) Date: Thu, 5 May 2022 13:36:29 +0100 From: Mark Rutland To: Sami Tolvanen Cc: LKML , Kees Cook , Josh Poimboeuf , Peter Zijlstra , X86 ML , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel , llvm@lists.linux.dev Subject: Re: [RFC PATCH 00/21] KCFI support Message-ID: References: <20220429203644.2868448-1-samitolvanen@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, May 04, 2022 at 01:17:25PM -0700, Sami Tolvanen wrote: > On Wed, May 4, 2022 at 9:41 AM Sami Tolvanen wrote: > > > > Hi Mark, > > > > On Wed, May 4, 2022 at 9:18 AM Mark Rutland wrote: > > > I wanted to give this a spin on arm64, but I'm seeing some very odd toolchain > > > behaviour. I'm not sure if I've done something wrong, or if I'm just hitting an > > > edge-case, but it looks like using -fsanitize=kcfi causes the toolchain to hit > > > out-of-memory errors and other issues which look like they could be memory > > > corruption. > > > > Thanks for the detailed bug report! It definitely looks like something > > is wrong with the recent switch from std::string to Twine in the Clang > > code. I didn't see this issue when compiling the arm64 kernel, but > > I'll take a closer look and see if I can reproduce it. > > I was able to reproduce this by turning off assertions in Clang. It > seems to work fine with -DLLVM_ENABLE_ASSERTIONS=ON. I'll go fix. FWIW, a `-DLLVM_ENABLE_ASSERTIONS=ON` build also seems to work for me when building a kernel with CONFIG_CFI_CLANG=y. It's much slower than a regular Release build, so I'm still waiting for that to finish building a kernel, but it has gotten much further through the build without issues. Thanks, Mark. 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6FBC9C433EF for ; Thu, 5 May 2022 12:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=hYoz8PfMJOVgQzF4rACfmlx50xjZt05KJUBbvezue6M=; b=41EqfYjmG1INl+ luuNjB/gO+XDBfh3P2XYSIZ5VH/JwEEvs9odfOLmmf49akbFKrKeAG4ys8AYTurn62om8tb1hpox7 FOmzETiPprw4C/KmQj5xlMOleMOOakaRt77soER4FY4BOPVutOwOMgcIG+B9HsWjXOQ9YDChUPwao Rb5X5sFP1y/XJgL9H1pmHMzr6xfLdGFanlFRqe4+V3DCGCcry2mBWxWZKWGwuFP0Gxsn0+08EiEWi z1uck4HHsMowhD5d7/I57soUXx05eyc1+RxSK+x9+L6N+QHtfyeNU/TPqDIY3Thl3GrcHTdOzR9Os vKWaTlNlraJNpL8u9+pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmaiu-00Fpq6-6v; Thu, 05 May 2022 12:36:48 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmair-00FpnY-J1 for linux-arm-kernel@lists.infradead.org; Thu, 05 May 2022 12:36:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A7A1F106F; Thu, 5 May 2022 05:36:39 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.29.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 918A43F885; Thu, 5 May 2022 05:36:37 -0700 (PDT) Date: Thu, 5 May 2022 13:36:29 +0100 From: Mark Rutland To: Sami Tolvanen Cc: LKML , Kees Cook , Josh Poimboeuf , Peter Zijlstra , X86 ML , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel , llvm@lists.linux.dev Subject: Re: [RFC PATCH 00/21] KCFI support Message-ID: References: <20220429203644.2868448-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220505_053645_701436_C482C326 X-CRM114-Status: GOOD ( 24.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Wed, May 04, 2022 at 01:17:25PM -0700, Sami Tolvanen wrote: > On Wed, May 4, 2022 at 9:41 AM Sami Tolvanen wrote: > > > > Hi Mark, > > > > On Wed, May 4, 2022 at 9:18 AM Mark Rutland wrote: > > > I wanted to give this a spin on arm64, but I'm seeing some very odd toolchain > > > behaviour. I'm not sure if I've done something wrong, or if I'm just hitting an > > > edge-case, but it looks like using -fsanitize=kcfi causes the toolchain to hit > > > out-of-memory errors and other issues which look like they could be memory > > > corruption. > > > > Thanks for the detailed bug report! It definitely looks like something > > is wrong with the recent switch from std::string to Twine in the Clang > > code. I didn't see this issue when compiling the arm64 kernel, but > > I'll take a closer look and see if I can reproduce it. > > I was able to reproduce this by turning off assertions in Clang. It > seems to work fine with -DLLVM_ENABLE_ASSERTIONS=ON. I'll go fix. FWIW, a `-DLLVM_ENABLE_ASSERTIONS=ON` build also seems to work for me when building a kernel with CONFIG_CFI_CLANG=y. It's much slower than a regular Release build, so I'm still waiting for that to finish building a kernel, but it has gotten much further through the build without issues. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel