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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 E66E9C433F5 for ; Mon, 14 Feb 2022 16:59:35 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.272556.467445 (Exim 4.92) (envelope-from ) id 1nJeh6-00085w-PF; Mon, 14 Feb 2022 16:59:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 272556.467445; Mon, 14 Feb 2022 16:59:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nJeh6-00085p-MS; Mon, 14 Feb 2022 16:59:20 +0000 Received: by outflank-mailman (input) for mailman id 272556; Mon, 14 Feb 2022 16:59:18 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nJeh4-00085i-O0 for xen-devel@lists.xenproject.org; Mon, 14 Feb 2022 16:59:18 +0000 Received: from ppsw-40.csi.cam.ac.uk (ppsw-40.csi.cam.ac.uk [131.111.8.140]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 715a940a-8db7-11ec-b215-9bbe72dcb22c; Mon, 14 Feb 2022 17:59:16 +0100 (CET) Received: from hades.srcf.societies.cam.ac.uk ([131.111.179.67]:54906) by ppsw-40.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.138]:25) with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1nJeh0-000KBC-jA (Exim 4.95) (return-path ); Mon, 14 Feb 2022 16:59:14 +0000 Received: from [192.168.1.10] (host-92-12-61-86.as13285.net [92.12.61.86]) (Authenticated sender: amc96) by hades.srcf.societies.cam.ac.uk (Postfix) with ESMTPSA id D25391FB34; Mon, 14 Feb 2022 16:59:13 +0000 (GMT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 715a940a-8db7-11ec-b215-9bbe72dcb22c X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: https://help.uis.cam.ac.uk/email-scanner-virus Message-ID: <5295e10c-d145-b6e3-d9a9-d345dc6cc93e@srcf.net> Date: Mon, 14 Feb 2022 16:59:13 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v2 21/70] xen/evtchn: CFI hardening Content-Language: en-GB To: David Vrabel , Andrew Cooper , Xen-devel References: <20220214125127.17985-1-andrew.cooper3@citrix.com> <20220214125127.17985-22-andrew.cooper3@citrix.com> <71b7ebd1-5cc8-54f4-f45d-5da71f2298f6@cantab.net> From: Andrew Cooper In-Reply-To: <71b7ebd1-5cc8-54f4-f45d-5da71f2298f6@cantab.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 14/02/2022 16:53, David Vrabel wrote: > On 14/02/2022 12:50, Andrew Cooper wrote: >> Control Flow Integrity schemes use toolchain and optionally hardware >> support >> to help protect against call/jump/return oriented programming attacks. >> >> Use cf_check to annotate function pointer targets for the toolchain. > [...] >> -static void evtchn_2l_set_pending(struct vcpu *v, struct evtchn >> *evtchn) >> +static void cf_check evtchn_2l_set_pending( >> +    struct vcpu *v, struct evtchn *evtchn) > > Why manually annotate functions instead of getting the compiler to > automatically work it out? Because the compilers are not currently capable of working it out automatically. ~Andrew