Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2281563iob; Thu, 5 May 2022 21:48:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWYDjuJBZ3EiwxMW2IEz1k2948iv4nelL0grzUfidVRCOvjrauwqAGGelFYb1EHSAC1bKO X-Received: by 2002:a17:902:f78d:b0:14f:ce61:eaf2 with SMTP id q13-20020a170902f78d00b0014fce61eaf2mr1682926pln.124.1651812502585; Thu, 05 May 2022 21:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651812502; cv=none; d=google.com; s=arc-20160816; b=PxoeJBb2HIRwSTrfksZB4F4t3WYwDKcnLKl+EQS396lahf7GfbYipKOyohihS7aMPH XTg7dFG0s5gCJPEybX/th/Dska0/0wOB1lar8qnoIy3vNJjW/XIAXOfz5ujGyAmNf/bP hmMZeWk92i9QB+oLMP/P6K7KZXX/t18VMK7kcKqKvzo683870ldu3GP4mtNixVMQQf2d OPaLHSA8Yy+YR3GOGnAsybW8pmIjkMMdNOqgkDlEKRJORTk1//vlVs+zyztve3tIRR2e DZwHaPw+ydxm0xTFQEhymXFaFIUh4+aKmqZff/zdRyZQuoN+9SiWFbdy67lZzm3KEzJq ZjJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=3jWLM7xTgBy5ggNh0CiCiJyFxTA/cImNiv73wdOLaxg=; b=tX0vU6X2vaU7uStmWVNPaevqzWqsuJjD5mmu55HGpwPO27AcwHW+SqE1Isjy+nw6J6 ria+wV80CF2tm3RIbcnPG+PUImBQxkJywClTfLjbZ3O9Rkh6f9kI6urMVVI+7DrE23VS EjGRYcb1F2JkxchbwSLZ6PunXaXPEMeCo8O0DjzvJrL2C/SzQNybI51x6uP9k9l37A/i NMQ1wLRmMFGziec70O5QuUEDUAPxhmOMzy5d2mvk36pB8k7HFK/VWxWVfkl35CyrKzty 3kUoYdQPNP58hPL/uDMvaohdo+B1ockP9eH9qTdyjMx9qMJYK6P0c6cOQBwXIUkWcZE6 uC2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e4-20020aa79804000000b0050a7b4bf744si3416774pfl.128.2022.05.05.21.47.40; Thu, 05 May 2022 21:48:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245544AbiEEMkW (ORCPT + 99 others); Thu, 5 May 2022 08:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235778AbiEEMkS (ORCPT ); Thu, 5 May 2022 08:40:18 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E24031CB22; Thu, 5 May 2022 05:36:39 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.