Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3560432iob; Tue, 17 May 2022 02:42:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh/dhzkAoPqqLlfVp8ZzvUkFJnYtrD0olS3nTwXA2l1bvByey+IvQbyleWH+Arq1ssHcGR X-Received: by 2002:a17:907:80c8:b0:6f4:3177:a0c9 with SMTP id io8-20020a17090780c800b006f43177a0c9mr19824368ejc.188.1652780563696; Tue, 17 May 2022 02:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652780563; cv=none; d=google.com; s=arc-20160816; b=LaTI8R9VNqRVLzQFpqgUX4XHhZokqgppc4NPNBN0iJa3SXbAKbi33roa7x7cHH9o95 38QJZWw0A6D0Axlv+7sue2a5+0J9GCudNgc3a9fqRnrUbEdK7H81o4YAKqttkPAC3kD8 lG0lHjCGS4Egf5bod4pSjjzPRB/yaG7NdEI+8RlNmUGejJMKBq1Pmoz2UpFj7euNypzE cTsSnKDamXiYn6Q/s0UBiyL7GA41+WbVH/EmpVffeLKeBO/sSBSKJSfB17yddIN/kVz2 zcZzj4CI/56c2bDclSoB3+1MKr+KfXBB3uH9EoVSi82TR2Y9kLSE0hfhH1MicWBzZLeI AWmQ== 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:dkim-signature; bh=1SCVVAHtClu+1FWsc5YTD1Uvr3wge/WoMABPfJaW99k=; b=qkwVG0HyArgFDTModn+k3yrjMMABYlSYXJcze8i+MlJivPmWSDO9OvtGoOu8OW6TkS GgWbB758FEwaoxlDPDyoYvzdkuHsxeBKNEIx6ABadhE1AsfKQHltwGid+7Sy6QMJiEX3 iixELnKCf09JVOz349tUyns2CJqI42DwLsFDrpotjFCU+fswhYfnGLkk3j8nixXAWNIm ga6+WRTBeuwggbC8YlAaENF+8oSCwu/OPmfB3rPEkiH/bLPaLvwGPqjwcB1Tg7lsWNwo E2R12rcgHO61cuQyn5tdq7kRN0g7p5XkZA4Zw8Cs+yjyevq2UloX11WlAzCM7+aFOwsr 6yOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=qEhWpebb; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt22-20020a170907729600b006f3d0d3aa1esi2297472ejc.101.2022.05.17.02.42.18; Tue, 17 May 2022 02:42:43 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=qEhWpebb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243430AbiEQI6V (ORCPT + 99 others); Tue, 17 May 2022 04:58:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244092AbiEQI6N (ORCPT ); Tue, 17 May 2022 04:58:13 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E261115A28; Tue, 17 May 2022 01:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1SCVVAHtClu+1FWsc5YTD1Uvr3wge/WoMABPfJaW99k=; b=qEhWpebbnSLca20mptfUhLsTth WXioCEDPccsX+uQXKR/gNXlIgWiHbdAeMKWBC3RPXtj8U/eKff585U7QCd1O5daXFEFQ8cMp4Jl4Y 6ucOdd0e7zRlMc01/8mnuXEB9tmsngezC8p/5pk9TFs2YmKQdEqDtsqWWnRQmBq9dguXgThGChB1d eQYTYGwlTANRuZ2lZoacSC6p8jTaNBMV8GcGpbFTkueKbBRe9G/nL8HwoZKXzSvDfcYpSHubktF8/ gh5FDjm/ukuL1HUi7uRaJ/Oe4G1cyieglJHOgoA76LSOPxolv74x2YPVA5V5/JIZvN7bSKmCmB+e4 uM8I4f7w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqt1c-001BZn-V9; Tue, 17 May 2022 08:57:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3367130018E; Tue, 17 May 2022 10:57:50 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 18EBE2023D0E2; Tue, 17 May 2022 10:57:50 +0200 (CEST) Date: Tue, 17 May 2022 10:57:50 +0200 From: Peter Zijlstra To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, Kees Cook , Josh Poimboeuf , x86@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [RFC PATCH v2 00/21] KCFI support Message-ID: References: <20220513202159.1550547-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220513202159.1550547-1-samitolvanen@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 Fri, May 13, 2022 at 01:21:38PM -0700, Sami Tolvanen wrote: > KCFI is a proposed forward-edge control-flow integrity scheme for > Clang, which is more suitable for kernel use than the existing CFI > scheme used by CONFIG_CFI_CLANG. KCFI doesn't require LTO, doesn't > alter function references to point to a jump table, and won't break > function address equality. The latest LLVM patch is here: > > https://reviews.llvm.org/D119296 > > This RFC series replaces the current arm64 CFI implementation with > KCFI and adds support for x86_64. You have some weird behaviour vs weak functions (I so hate those)... 100: 0000000000000980 9 FUNC LOCAL DEFAULT 2 __cfi_free_initmem 233: 0000000000000989 35 FUNC WEAK DEFAULT 2 free_initmem With the result that on the final link: 179: 00000000000009b0 9 FUNC LOCAL DEFAULT 1 __cfi_free_initmem 8689: 00000000000007f0 9 FUNC LOCAL DEFAULT 65 __cfi_free_initmem 173283: 00000000000007f9 198 FUNC GLOBAL DEFAULT 65 free_initmem This is getting me objtool issues (I'll fix them) but perhaps it's something you can do something about as well.