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

Re: [PATCH] x86/livepatch: enable livepatching assembly source files


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 18 Apr 2023 13:48:38 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=MRUdGIkBe+/samxQSGlU7uiOQ2DDQnQ65pV1K5DDiSI=; b=AwiUbdAAPdVJp/CXHiKy8c9tVsk25wpp97vdZDzNi4upXT8P40MV+k8X17cGHp5nrTusLMCBJHT0hEFMmQ6S9K7Lw4Woeobv9EhKpeUN75mbFQ4lI7LdiKTTqMRFUOvE9Y0OBhTQD9/aIO64TcDY5xMFyrdsPyfDNMYQZxPTsJGuPTjTNq3LduMZIhPBCczxIb7cBP9EaWyGD3NNfVH2x+EeX0Oc5/JCrlEsqceXlG4+FUp2jTqQqfX9WZiTjqhu2k/uZv85uHtI7q1SV4Qlk/PXJMQJnx7z6YN7hgRy+kAHzGZ4tVsLzHq1PLtTTRtwYNCKsx5FuRAf+sx+PHhQsg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i4vVERsht+FW+BYw9aUa4i0AU3p28d2eEpYOTsvZLljx7FjfdMLeIgw9TwgWDUbmyCsA4N6RKuSKibwVGBVLbrwPSqxNHbYZH8NPAwCE2sP2I758m+He9yJ800MilxPfPSoSq3NRuDX0XUNmZdmr8bCkLWZn9ev8A5irDxgAW0eJm2vJWDaZF4/i6mqrPijXmjxjaP18n5qKzDsIDevN/gfSHxF36Q7VrKFjY+MrZLjh07dPpJXmtdT/6k2n/VfemYA9doL3dtxEGiaPNLDVoA/6FoHKMLzNK0oKl8tglEoZoe6HokjOMv52/EpeLtC8imTjD87E9nsjD9X93KsDVw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 18 Apr 2023 12:50:10 +0000
  • Ironport-data: A9a23:UDGNuKhPdbWpKVb8mPKDIJ+eX161TxEKZh0ujC45NGQN5FlHY01je htvD2CBOKqNZzbyLdpwbIi+8U0Cv8CByYc3GgFq/CFhQyMb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWj0N8klgZmP6sT4AaOzyN94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+ tQ4ImlUcEyYo9ifnuLmbMM23eMpLuDkadZ3VnFIlVk1DN4AaLWaG+DmwIEd2z09wMdTAfzZe swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilEhluG1YbI5efTTLSlRtm+eq njL4CLSBRYCOcbE4TGE7mitlqnEmiaTtIc6TeXlp6430AHLroAVIDQ3ZVyFvvC/tlyRXdV0F UUXqyUkkqdnoSRHSfG4BXVUukWsvBQRRt5RGO0S8xyWx+zf5APxLncAZi5MbpohrsBebSwn0 BqFks3kARRrsaaJUjSN+7GMtzSwNCMJa2gYakc5oRAt5tDipMQ/i0zJR9M6SKqt1IStSHf33 iyAqzU4i/MLl8kX2q6n/FfBxTWxupzOSQ1z7QLSNo640j5EiEeeT9TAwTDmATxodtjIJrVdl BDoQ/Sj0d0=
  • Ironport-hdrordr: A9a23:Abe2JqhAjyEPUkPl5erW94uAWnBQXvUji2hC6mlwRA09TyX+rb HNoB17726WtN91YhodcL+7WZVoPkmsk6KdjbN/AV7aZnifhILwFvAY0WKA+V3d8k/Fh5RgPM 5bGsAVNDSaNzZHZKjBjDVRx74bsaC6GHnEv5a6854Ud2xXg1wJ1XYcNu6AeXcGIzV7OQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18/04/2023 12:00 pm, Jan Beulich wrote:
> On 18.04.2023 11:24, Roger Pau Monne wrote:
>> Some of the assembly entry points cannot be safely patched until it's
>> safe to use jmp, as livepatch can replace a whole block with a jmp to
>> a new address, and that won't be safe until speculative mitigations
>> have been applied.
> Isn't the issue only with indirect JMP, whereas livepatch uses only
> direct ones?

We already have direct jumps prior to speculation safety logic. 
Livepatching putting more in doesn't change our safety.

>> --- a/xen/arch/x86/include/asm/config.h
>> +++ b/xen/arch/x86/include/asm/config.h
>> @@ -44,6 +44,20 @@
>>  /* Linkage for x86 */
>>  #ifdef __ASSEMBLY__
>>  #define ALIGN .align 16,0x90
>> +#ifdef CONFIG_LIVEPATCH
>> +#define START_LP(name)                          \
>> +  jmp name;                                     \
>> +  .pushsection .text.name, "ax", @progbits;     \
> In how far is livepatch susceptible to two .text.* sections of the same
> name? This can result here and perhaps also for static C functions.

Well - the section is the unit of binary-diffing noticing a difference.

If we have a naming collision here, then I expect the linker will merge
the two section, and the livepatch will end up bigger than it strictly
needs to be.

~Andrew



 


Rackspace

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