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

Re: [PATCH 1/2] livepatch: do not ignore sections with 0 size


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 17 Mar 2022 15:16:27 +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=se6V635QQum1GKJl3Gv2BZx4vrwJQegrEK9GB93azUA=; b=j6bMmqW3R8aTMy4GvJIqMwkfT7aFG1yyPOgg+Fy3wLtjGS90YEUyPeyiMjWYIqpvBT+wCcxVsYKIzHkMyKjTfIll0/xvVCqrUSgnYDb2SVL1ggfDMzpaBFTXu1Kqs8dJPEuW0mexqUj18NdcAsSssiGn3kz/LbX62u7tzKmRu+IiheqLNe0B2BYLCwAjYYnnydnxJei+G+P47+uyglthZMehQpRp72o18Kw0Tar6j4GXBEuUyTye4gBsJJb5sXQKudEsKEwwz1U1en0NcK693Mg0stts0vHWhX5jO2B8I/pV0Eh8PlApe/vacS8OEvbigfjzAKgsuHENStkfPmyJzg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cpWXDAhKDjjV9m8PW2+vI765IwBV/8+P2k4n8IE4YlM802x7nTPynxpa5QF70V//aSTiRLAubpr6UcH9QUBo6nCU12FBqYKBLTDmx/6KgwslCZo98doJWr/H4bl+NdeIlQtjXiJ0jgkfBUAjLf6itE7P7kKQzOve5GZPrm0ieo39BWNxr1rpwYkm0hS6Wan0eQMO+KodL4I3H1P3NIrvsv4rHCl877cFQ6TbhkVqVYATZHe6+2smvWG6vId8r9HNl4hjtPfC7gpDMd6P3r8PfXJhdPwAJrTplX/GntfxgrnsOuxHH10pB2bzQXrlkero0dtgVEohkLzxklz/QwAkOQ==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Konrad Rzeszutek Wilk" <konrad.wilk@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Delivery-date: Thu, 17 Mar 2022 14:17:14 +0000
  • Ironport-data: A9a23:48vQfa4pBC/vduEgeUYA0wxRtDbHchMFZxGqfqrLsTDasY5as4F+v mMaX2nSOP2LYDTxKt50PojlpB4EvcDSzNY3SVZq+3g2Hi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw0XqPp8Zj2tQy2YPgXFvX0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurStEy4PAY/noN42CUMJTw9VY/F0o7vudC3XXcy7lyUqclPpyvRqSko3IZcZ6qB8BmQmG f4wcW5XKErZ3qTvnez9GrIEascLdaEHOKsFvX5t13fBBOsOSpHfWaTao9Rf2V/cg+gQQ6uGP JpHOFKDajzKOEZwAXwSNqtv3+iWrye8IhdchQKK8P9fD2/7k1UqjemF3MDuUt+NQ99ckgCHp 2bF12PjCxoeOZqUzj/t2mKhgKrDkD32XKoWFaak7bh6jVuL3GsRBRYKE1yhrpGEZlWWAowFb RZOo2x38PZ0pBfDosTBswOQvSStmCE+cOJqOLdguV2j4fSI0V2dLz1RJtJeU+AOuMgzTD0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3QSuvyAfcZek600ykke+C3Fxy3pDsRKA1
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Mar 17, 2022 at 02:00:19PM +0000, Andrew Cooper wrote:
> On 17/03/2022 11:08, Roger Pau Monne wrote:
> > A side effect of ignoring such sections is that symbols belonging to
> > them won't be resolved, and that could make relocations belonging to
> > other sections that reference those symbols fail.
> >
> > For example it's likely to have an empty .altinstr_replacement with
> > symbols pointing to it, and marking the section as ignored will
> > prevent the symbols from being resolved, which in turn will cause any
> > relocations against them to fail.
> 
> I agree this is a bug in livepatch handling, but it's also an error in
> the generated livepatch.  We should not have relocations to an empty
> altinstr_replacement section in the first place.

Well, the relocation destination is in the .altinstructions section
(which is not empty). It happens however to reference a symbol that
points to the .altinstr_replacement section that's empty.

We could likely avoid generating the altinstr_replacement section in
the first place, but I think it's more robust to handle those properly
in the elf loading code.

> This will probably be from the lfences, where the replacement in a nop
> and takes no space.  I think I know how to fix this case.

Indeed, that's my understanding.

Thanks, Roger.



 


Rackspace

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