From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE97F10E8 for ; Tue, 17 May 2022 08:58:05 +0000 (UTC) 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> 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: <20220513202159.1550547-1-samitolvanen@google.com> 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. 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 6F889C433EF for ; Tue, 17 May 2022 08:59:08 +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=te4yPCNS0+WK9Ec/2gCCJzoH95W7vmaJeOl8N2DfgjE=; b=zoI0M9FVF6qCTJ wzxfTbLizvYYgOem3PsAihHwddzxLgjUvCImuB392rq8Pedf01KLI30KxyhEtd89bHK01UkQIL2Ka +bvCNe6stsFRDp/8fTSEkVeETszjgnkdRSi1GkBkzLWvpIkI5O2d9W+2s1MbHX7oGYZl7j34qOkjr bB6NTEO68+qTQjaAHhhNsfS1hlVggRsplCU3GWkn2yjNYUmIqrcgLcrR67ON2aSBv0CFLapwwxagr OwKms04TtF4tdFTEsZ0A6XqxoGplfhxz7mblugbAU5aegypAacg42cnaSQqQFa5H3ZMWdDA5EyqP+ SoK2FNQGol8RVfNEoozg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqt1m-00CbVs-Jb; Tue, 17 May 2022 08:58:02 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqt1j-00CbUa-SI for linux-arm-kernel@bombadil.infradead.org; Tue, 17 May 2022 08:57:59 +0000 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-Disposition: inline In-Reply-To: <20220513202159.1550547-1-samitolvanen@google.com> 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel