[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/spec-ctrl: Disable retpolines with CET-IBT


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 1 Mar 2022 08:59:47 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bmZljKsuipJZNrFyF0W6Vga6KwbGVTf3g9zbiLcGc2Q=; b=JyISvSO8Q8/vSU3NIT8MMpgvxR1EbF+gkJDOfELotm4fd3lozKhaaxEQxq9cTrc6UYhGLs1QKebVRy2tr4HI2AlQ7NjBMtqTSnZLzhxK3P++sw5xcy5F4JfOoNXnTAcYSNB/a4g21lIykWEoxMzGnMVm1+exbsm2dYhq4mD/o7q6XTxIlz1WWDZMuqE083LxHLpHNGwAMCjfDDXwvI4zZV1WoX2tmSEI3OUR/yhwlwMGnEu6QjE+wUd2M54RTYulphTitogTGucmRaS2+tWduq1321hLo87xu+hVVvgO0xcs0nZmpZ+tZnhX3Kek3+dlw4OIFTViJFSPpRH8KWafbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lieZF3Dm9vzlwmrhF+63sDTj6vVWllum6zIu+/s+fMbj+MIIXZiTvCUWkjrB3DywqijDtHPTr4O3V8q4SoLEEt9b/IIFxneS9nGwIf2m+NGytsYIZY3CbasU9O09WpAA0AsQ+zkH4lGcdXNBJcyrLMqljdfxjA1PNy9G0qGtIbSztZubuQZzr1kPExIf9MQtXQzHuhIp7Xg2YHSOgHuqdK1xHTXSOIguNmPf4OWjMSpynGarkqjwuNvS9938hOg6HrObpL/Df1AeKZhT7IKN+UPX8k36POmNTbaEgN9YEHsHl0z8IWsrjW3SI0+N4dknjlxmN/FqWF7gyKIsTYUh7g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 01 Mar 2022 08:00:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.02.2022 23:51, Andrew Cooper wrote:
> CET-IBT depend on executing indirect branches for protections to apply.
> Extend the clobber for CET-SS to all of CET.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> I can't decide if this wants a fixes tag or not.  If I'd remembered during the
> CET series, it would have been its own patch.

On this basis I'd say no Fixes: tag.

> --- a/xen/arch/x86/spec_ctrl.c
> +++ b/xen/arch/x86/spec_ctrl.c
> @@ -944,10 +944,11 @@ void __init init_speculation_mitigations(void)
>                       boot_cpu_has(X86_FEATURE_IBRS));
>  
>      /*
> -     * First, disable the use of retpolines if Xen is using shadow stacks, as
> -     * they are incompatible.
> +     * First, disable the use of retpolines if Xen is using CET.  Retpolines
> +     * are a ROP gadget so incompatbile with Shadow Stacks, while IBT depends
> +     * on executing indirect branches for the safety properties to apply.
>       */
> -    if ( cpu_has_xen_shstk &&
> +    if ( (read_cr4() & X86_CR4_CET) &&
>           (opt_thunk == THUNK_DEFAULT || opt_thunk == THUNK_RETPOLINE) )
>          thunk = THUNK_JMP;

Just for my own understanding: Why unconditionally THUNK_JMP and not possibly
THUNK_LFENCE?

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.