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

Re: [PATCH v2 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 09:07:53 +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=dVsBHgTQhgRYrpY17WjFcdPVjzBQlMdlRS0U1Tvchn0=; b=NOw0ooHMI8OBwoq/MNAJrUomVu+JoVL5xY5Ar/8hIwZGDGhAmU1SuTNq2yyEqKDQ/2g0/5XL8lv85GPUAF8D+w9u1Bg+k5mizsSw0YXcmDZYe9hVjlTMntV1LHiUTDFyp3/hzxcCmirJREdEfpWweUuioYyYxJTluftlMLu2v+0+1vcTXoUvFLNuMtgvo2LFeSP4AO+WlSBwf26i8Kjb3cpeONJXV9y/VsaTJZi06gNVhY2h/LI8vmyCBShaG5e+8kYducViG4mCge31ZJE2AVaLOwH5iSVcNVWWaX/dbrwivXM2UeKkjVFgX6u1mufTIPAp/OKu9NTKFFkyINryMg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OWkkuWTjgvXRQ0XlPFEkCkPsK2Gc5tnSZxqoT+f2ozRKzyVeTItSVzZ6N0+mVl6XnheY88EmJ0QjcdklBrbwXsWheB4VcTOWi24idXs32tWEZf5pogkC0Y+Izr8HXj+3OwdJQOaqmBE5Er1WWswLqwmLtT66yjPtS02da1X/1+buzmgLe3ObObApN0KYQnw4jxFqlDHmRuqbUGKYNsmfF5UM0lEvrbhbEaclM6c2u7jMgp4u3u1ufGskux16hPHlzvBMpfkeY9jmQtcuCWuand6oClVkyxvo6fduvoUQ2MYmUac0wEuizd2iPqO6GebgRU+a6WeddoscMyMhDwPObw==
  • 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 08:08:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.03.2022 22:13, Bjoern Doebel wrote:
> @@ -159,7 +200,11 @@ void noinline arch_livepatch_apply(struct livepatch_func 
> *func)
>   */
>  void noinline arch_livepatch_revert(const struct livepatch_func *func)
>  {
> -    memcpy(func->old_addr, func->opaque, livepatch_insn_len(func));
> +    struct x86_livepatch_meta *lp;

Repeating my comment here a 3rd time (sorry): const please (and
generally wherever possible).

Jan

> +    lp = (struct x86_livepatch_meta *)func->opaque;
> +
> +    memcpy(func->old_addr + lp->patch_offset, lp->instruction, 
> livepatch_insn_len(func));
>  }
>  
>  /*




 


Rackspace

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