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

Re: [PATCH v4 2/2] xen/x86: Livepatch: support patching CET-enhanced functions


  • To: Bjoern Doebel <doebel@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 8 Mar 2022 16:40:35 +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=klhwGBiEX68giHVeLF5GuUDfbg1XCXAVNjJ5rg2LPqI=; b=k/6241eh7EfNYb5ik5NFDsPqRGzjFV2ZfqldwKVu0+SOEuYalLTzPrE3R7PTj7aT5jF6Hc4cc5euWZLNBu4Sf6oGPe8QEZb8tQRX/BYERkz06zp480bYlL5CwD/N05ODJqoXztc2TXkb7J9bVg83gSXEO5uMoE6l0gpO//laijtEZkeo96kf5bBbwHaiXNFWg7MlxPRNl/q5KADoJiFU2w1LweJKRg4jxiuMaGovhN+8nNymPYaf0OvzHVTVIrtKKx/wXH0odHr465YyH0o9nayfteIV8lVR5gdpn0f7C6e/lEu6+3GD33draE1O/pYU4KQkUw1MEqdITTnfzgA8NA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mbWCK/Jw1MRIj1gQ3j0dwzNdTfa1UzU2NnZGzNFWM8uKVHX2BEXd4PHycksDWA/9vEseH8CfCdfANym4qoXh6cGuRyrtceC/H2jDaCSyZtm/HoQ9UCFZjxL+6FbJooQeDgTGEs/pks7IQ88BibayKvtU9MwYH0ZqOWtDprvW30kw5CGdg/YOD8C2qmUpRNTmU7XhsPTjwiPQv0wYmh09/12BZscj2g4BTNKWdxecDdHB4gmYcNFNLiTT8i9SmwBR8WIuVIfjDMzSwI9feiDe2E2jHufixYWgr/hbjOjYEsEb1FLjgl22E1xsARMqpBcjTUxmOa/vwI1Or0TGshvdPg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Michael Kurth <mku@xxxxxxxxx>, Martin Pohlack <mpohlack@xxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 08 Mar 2022 15:40:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.03.2022 16:23, Bjoern Doebel wrote:
> @@ -127,15 +161,21 @@ int arch_livepatch_verify_func(const struct 
> livepatch_func *func)
>  void noinline arch_livepatch_apply(struct livepatch_func *func)
>  {
>      uint8_t *old_ptr;
> -    uint8_t insn[sizeof(func->opaque)];
> +    struct x86_livepatch_meta *lp;
> +    uint8_t insn[sizeof(lp->instruction)];
>      unsigned int len;
>  
> +    lp = (struct x86_livepatch_meta *)func->opaque;
> +    lp->patch_offset = 0;
>      old_ptr = func->old_addr;
>      len = livepatch_insn_len(func);
>      if ( !len )
>          return;
>  
> -    memcpy(func->opaque, old_ptr, len);
> +    if ( is_endbr64(old_ptr) )
> +        lp->patch_offset += ENDBR64_LEN;

Don't you need to use was_endbr64() here as well?

Jan




 


Rackspace

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