[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 3/5] xen/livepatch/ARM32: Don't load and crash on livepatches loaded with wrong alignment.
>>> Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> 07/31/17 6:04 PM >>> >On Mon, Jul 31, 2017 at 07:55:34AM -0600, Jan Beulich wrote: >> >>> Konrad Rzeszutek Wilk <konrad@xxxxxxxxxx> 07/26/17 9:50 PM >>> >> >--- a/docs/misc/livepatch.markdown >> >+++ b/docs/misc/livepatch.markdown >> >@@ -279,6 +279,10 @@ It may also have some architecture-specific sections. >> >For example: >> >* Exception tables. >> >* Relocations for each of these sections. >> > >> >+Note that on ARM 32 the sections SHOULD be four byte aligned. Otherwise >> >+we risk hitting Data Abort exception as un-aligned manipulation of data is >> >+prohibited on ARM 32. >> >> This (and hence the rest of the patch) is not in line with the outcome of the >> earlier discussion we had. Nothing is wrong with a section having smaller >> alignment, as long as there are no 32-bit (or wider, but I don't think there >> are any such) relocations against such a section. And even if there were, I >> think it should rather be the code doing the relocations needing to cope, as >> I don't think the ARM ELF ABI imposes any such restriction. > >The idea behind this patch is to give advance warnings. Akin to what >2ff229643b739e2fd0cd0536ee9fca506cfa92f8 >"xen/livepatch: Don't crash on encountering STN_UNDEF relocations" did. > >The other patches in this series fix the alignment issues. > >The ARM ELF ABI >(http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf) > >says: > >4.3.5 Section Alignment >There is no minimum alignment required for a section. However, sections >containing thumb code must be at least >16-bit aligned and sections containing ARM code must be at least 32-bit >aligned. >Platform standards may set a limit on the maximum alignment that they can >guarantee (normally the page size). Note the "thumb code" and "ARM code" in here - iirc you're checking _all_ sections, not just ones containing code. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |