From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49894623 for ; Sun, 15 May 2022 03:41:40 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id l20-20020a17090a409400b001dd2a9d555bso11291443pjg.0 for ; Sat, 14 May 2022 20:41:40 -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=yTJ/JqBThBUULFI/eq0KMUagYlEy+U8Gm8DCXUOLqI4=; b=Nj4rFH2iGcDCRWm7En8MMB9PlgCsyGVxQAPs7BMHVclQ27z31PBw6Dxdm3IvfWzPAV L7mSdonC/7b1wN1otPDwe1wD51BlBkiLnb6TRuJ8hkgKwbPpocmSPsCRB/70parsHMgc 4ME6hu5g6TfCBsYNyr2rW8AOj4lsDpFe7p17c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yTJ/JqBThBUULFI/eq0KMUagYlEy+U8Gm8DCXUOLqI4=; b=txFR/lVxTjKZZ2ZdDXK7NvFIh4AKJs6odCepOOe3Hj6oT7V8Kv9aYuh++pXyHH6GH/ Aq1Vt1ogTga+BMTMV4P0DCan1lQHnGMdSi2JkDh5ZUDK9i6tQCFm8iM6Benj6Ju8+b0I rom1FV/CitNfATRI9/IflCi+vQdYojxCyyPWrbcly52U7IdGBOifSwUpTqmefM4LKJTf 7HsOjp5XFlpAcC3OAhAP4ecYC/NTqKisE8sD5SASq1SKNxwAPg1rsqu6mHMOdMtDvZ6z fr2An+vFbIA2nVUJkPX0w5ih6B0aSVmvtoIUx9NebQcguBcpVkcZkv7l0jPe/jDiDP3h /AMQ== X-Gm-Message-State: AOAM531BKP5l5JOlyHenrxLCAjXpYfE2sa6w8uLhj8ru4IoKjCZKDu5F MyK9KGpb6xp2n2FEG9o+dK6tOQ== X-Google-Smtp-Source: ABdhPJzZ7tgR5pXn1XQv2q/TxKce2IqTRDTreHqkACR4UFVQZMe4HvU+Dngyrw5oYGEcUo13rmdg5w== X-Received: by 2002:a17:90b:1251:b0:1d7:f7ae:9f1 with SMTP id gx17-20020a17090b125100b001d7f7ae09f1mr24122359pjb.65.1652586099705; Sat, 14 May 2022 20:41:39 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id cu8-20020a056a00448800b0050dc76281b3sm4375942pfb.141.2022.05.14.20.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 20:41:39 -0700 (PDT) Date: Sat, 14 May 2022 20:41:35 -0700 From: Kees Cook To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, Josh Poimboeuf , Peter Zijlstra , 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 06/21] cfi: Switch to -fsanitize=kcfi Message-ID: <202205142031.A3322C75@keescook> References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-7-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-7-samitolvanen@google.com> On Fri, May 13, 2022 at 01:21:44PM -0700, Sami Tolvanen wrote: > Switch from Clang's original forward-edge control-flow integrity > implementation to -fsanitize=kcfi, which is better suited for the > kernel, as it doesn't require LTO, doesn't use a jump table that > requires altering function references, and won't break cross-module > function address equality. > > Signed-off-by: Sami Tolvanen Looks good on arm64 with LKDTM, too: [ 96.904483] lkdtm: Performing direct entry CFI_FORWARD_PROTO [ 96.904718] lkdtm: Calling matched prototype ... [ 96.904829] lkdtm: Calling mismatched prototype ... [ 96.905250] CFI failure at lkdtm_CFI_FORWARD_PROTO+0x54/0x94 [lkdtm] (target: lkdtm_increment_int+0x0/0x20 [lkdtm]; expected type: 0x7e0c52a5) Tested-by: Kees Cook -Kees -- 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 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 29EBBC433F5 for ; Sun, 15 May 2022 03:42:49 +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=KnMbIAhjFdLoeI0fIS6cGOUDCWbMTQG/HZ+g0ft3pq4=; b=T7o3z0FO2GXxB6 msLYR0F6kVjHAg4KanqCUT557vGeJmGbh8OhYFakq7S4xHsYOLhSlA2rr/VDmhGBO0svOaSQMJkRJ 40yxFI4e1qvOKSPowfJYeZbvZ6X39MjLRRCTUtx1DRH+cm9K6aGtgJBgWF4unnTnzvtMqgDCe0oqb ea0nqD/lmnFYCR580CkG82uSThZKaYomdpmdcMDeRu8mSPzlC6YY+V0PkJAJEfJaa9Azmn7bZDKaD mnpinHAw5GHto/gokYGwm0mp105XWnX0s8RnCQ89PNs5hrqSKfAARvYDrBV9VJ6LbUqjoJKjyhIkZ ibU5dsdcYyWzoeWJwsAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nq58c-0035dh-AF; Sun, 15 May 2022 03:41:46 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nq58Y-0035cV-SA for linux-arm-kernel@lists.infradead.org; Sun, 15 May 2022 03:41:44 +0000 Received: by mail-pj1-x102c.google.com with SMTP id l14so489910pjk.2 for ; Sat, 14 May 2022 20:41:40 -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=yTJ/JqBThBUULFI/eq0KMUagYlEy+U8Gm8DCXUOLqI4=; b=Nj4rFH2iGcDCRWm7En8MMB9PlgCsyGVxQAPs7BMHVclQ27z31PBw6Dxdm3IvfWzPAV L7mSdonC/7b1wN1otPDwe1wD51BlBkiLnb6TRuJ8hkgKwbPpocmSPsCRB/70parsHMgc 4ME6hu5g6TfCBsYNyr2rW8AOj4lsDpFe7p17c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yTJ/JqBThBUULFI/eq0KMUagYlEy+U8Gm8DCXUOLqI4=; b=l/dwqbLLVnqISUU57j3iXhukF9Iv7qC1N583nhouDo6iht9cWWCspL/Zu895CCGLK8 9xQvWFXsfkHbK3PA5fzouONDvUWuIUZsNFtH3FD1XUFW6dS+wu5lIpkj8rDbALqgq9cm 0Hk0XznYFZoYH99o4ZFXcD8paCx++5Wkgu+QHGqO1bGw34x89o0GwOPVE2vCEgQ7eDYK se3rsQh1UTBV0Z5Bfb47nknseG5ALYmtlPmiSf/LI629x4Poa1IOS81htgfGEgQ5Zen0 n+VhknA0UrqOx81UlWSzlQpi8Ewyat8X0DwZueN47NNT8RoHI7BBDAKIoSkWLTxpxPOh bacA== X-Gm-Message-State: AOAM530Po6jx97u5ahTL3EK71zustdxGzHJrlDAv+mh1q5dX2pGvXRcT a1lZaYDr5A2+NXjvlhfBTV+Hfw== X-Google-Smtp-Source: ABdhPJzZ7tgR5pXn1XQv2q/TxKce2IqTRDTreHqkACR4UFVQZMe4HvU+Dngyrw5oYGEcUo13rmdg5w== X-Received: by 2002:a17:90b:1251:b0:1d7:f7ae:9f1 with SMTP id gx17-20020a17090b125100b001d7f7ae09f1mr24122359pjb.65.1652586099705; Sat, 14 May 2022 20:41:39 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id cu8-20020a056a00448800b0050dc76281b3sm4375942pfb.141.2022.05.14.20.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 20:41:39 -0700 (PDT) Date: Sat, 14 May 2022 20:41:35 -0700 From: Kees Cook To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, Josh Poimboeuf , Peter Zijlstra , 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 06/21] cfi: Switch to -fsanitize=kcfi Message-ID: <202205142031.A3322C75@keescook> References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-7-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220513202159.1550547-7-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220514_204142_971786_051CED83 X-CRM114-Status: GOOD ( 10.96 ) 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:44PM -0700, Sami Tolvanen wrote: > Switch from Clang's original forward-edge control-flow integrity > implementation to -fsanitize=kcfi, which is better suited for the > kernel, as it doesn't require LTO, doesn't use a jump table that > requires altering function references, and won't break cross-module > function address equality. > > Signed-off-by: Sami Tolvanen Looks good on arm64 with LKDTM, too: [ 96.904483] lkdtm: Performing direct entry CFI_FORWARD_PROTO [ 96.904718] lkdtm: Calling matched prototype ... [ 96.904829] lkdtm: Calling mismatched prototype ... [ 96.905250] CFI failure at lkdtm_CFI_FORWARD_PROTO+0x54/0x94 [lkdtm] (target: lkdtm_increment_int+0x0/0x20 [lkdtm]; expected type: 0x7e0c52a5) Tested-by: Kees Cook -Kees -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel