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

Re: [PATCH] create-diff-object: handle missing padding at end of special section


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 14 Apr 2023 17:17:42 +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=L2cWvCC3TMiknbAQJ70yQk3bXAIp5XaHNtdnUXOvN9U=; b=hc2x5vLF0vH83rcA9kpQcULumJuhq5dzBTKITvkMsd5Y8u6ZEbj7joFo+ofm67rkaHfjr7c9sQjR+odhmdQe73/JSfHte2UrrdeH8vXKgfFJGpKPn34YKrIBFZX0ASH7JIT1PZYKbtERrqFWj7rrWNGg0IbKOlVHexGMhyFcI7sLUYFpo2/AzjEFEs374Gc2R7fS3EsPTjBiLeTOJeU2bA609EQWrGJaPUuukRfMMIEWvwuy/46XdG2n/8uZdnw7JywHYCYqQVEEbj7wl/t1omqHLme+ign7X1u+xH74G8ZUY+e9LOH14wYNBmLLXh2bm19MDs4xx2g/gpgiW+AxkQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iSaa6kniLshVYGTCxCioV6nXhUPqC/RglUMZ8UFbbYAqx7gE+t/NfQhVb2iPPmZo/j/3wXRh/bwn1YFYm65zGGp5peMSTVT0p9pSWyqxp28s1ogrxaSVEjwGFjE/ZKgy52qwQTlki29c5Q2sLIzD+UxrrYP2/Z/d8L0OiyXYfiUtd5nsxNKnZesa25WvKeT0KPtRofW89g7P4Ya2ryEmlJ+YA55/DsQv0sxsdmuI2fr8wfvBoMGvlTL/j5ziCT/hJzIAfe9PzkqScyo8BTRkuxZmQggTVnRJVsphezyfM72YwozaggRDGzpPMvm5+/Gr18xlgouSGQ+a8nCCrt9gpg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Delivery-date: Fri, 14 Apr 2023 16:18:13 +0000
  • Ironport-data: A9a23:jETZSq9Kj7dclMeJLKEfDrUDs3+TJUtcMsCJ2f8bNWPcYEJGY0x3x jNNXG+OO66JZTT2L9AlOoy1908C6sCHyddlGQdspH88E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kI+1BjOkGlA5AdmOakX5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklEq tY6cCtSRymIoL7u/fW3Q7lr2MUKeZyD0IM34hmMzBn/JNN/G9XvZvuP4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWCilUvgNABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTAdpPSODgqqQ76LGV7nUxIz4ZVUeZm+DjiECjfdVBe mMwpCV7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3Oc0XTsr0 1WOkvvzCDBvuaHTQnWYnp+XqjWoMCRTMm4GZgcDVwIO59Slq4Y25i8jVf5mGa+xy9HwRzf5x mnQqDBk3utDy8kWy6+84FbLxSq2oYTERRI04QORWX+56gR+Z8iuYInABUXn0Mus5b2xFjGp1 EXoUeDHhAzSJflhTBCwfdg=
  • Ironport-hdrordr: A9a23:uwxzfq0nPVxyfly5OkMGaQqjBVVyeYIsimQD101hICG9Lfbzqy n+pp8mPEHP4Ar5AEtQ/+xpOMG7IU80hqQFmLX5XI3SKjUO3VHEEGgM1/qH/9SNIUPDH41mpO 5dmspFebrN5DFB5KqU3ODSKadC/DDzytHMuQ6o9QYOcegFUcBdxjY8LjzePlx9RQFAC5Z8Po Gb/NB7qz2pfmlSRtinB1EeNtKz7OHjpdbDW1orFhQn4A6BgXeD87jhCSWV2R8YTndm3aoiy2 7YiAb0j5/T+c1TiyWsmlM73a4m1+cJ+eEzSvBkv/JlZgkExDzYJbiJEIfyxAzd6Nvfk2rC1u O86yvIdv4Dlk84cgyO0GHQ8hil3zA053D4z1iExXPlvMziXTo/T9FMnIRDb3Limj8dVfxHod F2NliixuhqJAKFmD6468nDVhlsmEbxqX0+kfQLh3gaVYcFcrdeoYEW4UsQSf47bVXHwZFiFP MrANDX5f5Qf1/fZ3fFvnN3yNjpWngoBB+JTkULp8TQ2TlLm3JyyVce2aUk7wM93YN4T4MB6/ XPM6xumr0LRsgKbbhlDONEWsezAnyle2O9DItTGyWXKEgqAQOyl3es2sRI2AiDQu128KcP
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14/04/2023 4:19 pm, Roger Pau Monne wrote:
> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
>
> The paravirt_patch_site struct has 12 bytes of data and 4 bytes of
> padding, for a total of 16 bytes.  However, when laying out the structs
> in the .parainstructions section, the vmlinux script only aligns before
> each struct's data, not after.  So the last entry doesn't have the
> 4-byte padding, which breaks kpatch_regenerate_special_section()'s
> assumption of a 16-byte struct, resulting in a memcpy past the end of
> the section.
>
> Fixes #747.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
>
> This is commit:
>
> c2dc3836e862 create-diff-object: handle missing padding at end of special 
> section
>
> In kpatch repository.
>
> I've seen the .fixup section get an alignment of 16 but a size of 81,
> which makes the error removed in this patch trigger.  Overall I'm not
> sure why the original alignment check was done against the size of the
> section, the alignment applies to the address of the section, not its
> size.
>
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Seems like a clean backport, so FWIW

Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

However, surely we want a correction to Xen's linker file too, to stop
putting out a badly aligned section?

~Andrew



 


Rackspace

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