Re: [PATCH] x86: cleanup boot-heap usage

From: Yinghai Lu
Date: Tue Apr 08 2008 - 14:39:33 EST


On Tue, Apr 8, 2008 at 3:54 AM, Alexander van Heukelum
<heukelum@xxxxxxxxxxxxx> wrote:
> The kernel decompressor wrapper uses memory located beyond the
> end of the image. This might lead to hard to debug problems,
> but even if it can be proven to be safe, it is at the very
> least unclean. I don't see any advantages either, unless you
> count it not being zeroed out as an advantage. This patch
> moves the boot-heap area to the bss segment.
>
> Signed-off-by: Alexander van Heukelum <heukelum@xxxxxxxxxxx>
>
> ---
>
> On Tue, Apr 08, 2008 at 10:23:54AM +0200, Ingo Molnar wrote:
> > * Alexander van Heukelum <heukelum@xxxxxxxxxxxxx> wrote:
> > > I did see that the malloc space that the inflate code is using is
> > > taken from _after_ the end of the bss. I don't see how this is
> > > protected from being used/overwritten. Changing the stack size changes
> > > the memory layout a bit... maybe you were so unlucky to create a
> > > vmlinux image that was just barely smaller than some threshold and
> > > increasing the stack size made the decompression/relocation area be
> > > located somewhere else?
the compressed image is copied to end of buff ( with extra code size
for from relocated: in .text to _end)
and do the on possition decompressed. .text section is near end.

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/