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

Re: [Xen-devel] [PATCH v4 1/9] livepatch: Clear .bss when payload is reverted



On 09/09/2016 02:50 PM, Konrad Rzeszutek Wilk wrote:
On Fri, Sep 09, 2016 at 02:33:18PM +0100, Ross Lagerwall wrote:
On 08/24/2016 03:22 AM, Konrad Rzeszutek Wilk wrote:
So that when we apply the patch again the .bss is cleared.
Otherwise we may find some variables containing old values.

The payloads may contain various .bss - especially if -fdata-sections
is used which can create .bss.<name> sections.


After having thought about this again, I'm not sure it makes much sense. Any
data sections in the payload are not reset to their initial values, so
resetting the bss only may result in an unexpected combination of new & old
data/bss.

Regardless of that I think clearing the .bss upon applying the livepatch is
still the right thing to do.

Regarding of the .data - we could have a copy of the .data the first time
we load - and then during application copy over it from the original one?.


Perhaps it just needs to be documented that a payload's bss/data is
untouched across revert/apply?

It really cuts down on bugs if we clear the .bss. It is kind of ingrained in 
every
developer that the .bss is zero-ed out at startup.


Sure.

IMO clearing one but not resetting the other is even more unexpected. However, if we agree that it is desirable to do both, then this patch is acceptable as a step in the right direction.

--
Ross Lagerwall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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