From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>,
tabbott@ksplice.com, vda.linux@googlemail.com, mmarek@suse.cz,
hpa@linux.intel.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, heiko.carstens@de.ibm.com,
schwidefsky@de.ibm.com
Subject: Re: [PATCH] Fix initramfs size calculation
Date: Thu, 26 Aug 2010 10:55:47 +0200 [thread overview]
Message-ID: <1282812947.1879.17.camel@holzheu-laptop> (raw)
In-Reply-To: <20100825195639.GA2263@merkur.ravnborg.org>
Hello Sam,
On Wed, 2010-08-25 at 21:56 +0200, Sam Ravnborg wrote:
> On Wed, Aug 25, 2010 at 09:15:32PM +0200, Hendrik Brueckner wrote:
> > Sam,
> >
> > I have work together with Michael on this patch... see my comments below
> >
> > On Wed, Aug 25, 2010 at 08:06:01PM +0200, Sam Ravnborg wrote:
> > > On Wed, Aug 25, 2010 at 05:57:12PM +0200, Michael Holzheu wrote:
> > >
> > > Another way to fix this could be to align . to an even
> > > address like this:
> > > > #define INIT_RAM_FS \
> > > > . = ALIGN(PAGE_SIZE); \
> > > > VMLINUX_SYMBOL(__initramfs_start) = .; \
> > > > *(.init.ramfs) \
> > > . = ALIGN(32); \
> > > > VMLINUX_SYMBOL(__initramfs_end) = .;
> > > >
> > >
> > > 32 was selected as this is what we will introduce as the default
> > > alignment in linker scripts anyway.
> > >
> > > This I guess is a problem we have had some time and a minimal fix is
> > > easier to have backported by the stable team.
> >
> > The first thought was similar but using ALIGN(2). However, the current
> > implementation of populate_rootfs() passes the calculated size to the
> > decompress functions. If __initramfs_end is aligned, the resulting size
> > might be greater than the real size of the initramfs.
> > So I guess this might also cause problems.
> Another variant could be to explicit add alignment in the .S files
> so the section is always aligned to a even byte boundary (or maybe 32 byte boundary).
Then still the unpack_to_rootfs() function will not get the correct size
of the compressed file, because "__initramfs_end - __initramfs_start"
can be bigger than the real file size depending on the used the
alignment. I would assume that not all decompression functions will
work, if a bigger value is passed to decompress_method().
Michael
next prev parent reply other threads:[~2010-08-26 8:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-25 15:57 Michael Holzheu
2010-08-25 18:06 ` Sam Ravnborg
2010-08-25 19:15 ` Hendrik Brueckner
2010-08-25 19:56 ` Sam Ravnborg
2010-08-26 8:55 ` Michael Holzheu [this message]
2010-08-26 11:41 ` [PATCH v2 0/2] initramfs: Cleanup and fix " Hendrik Brueckner
2010-08-26 11:41 ` [PATCH v2 1/2] initramfs: Generalize initramfs_data.xxx.S variants Hendrik Brueckner
2010-08-26 11:41 ` [PATCH v2 2/2] initramfs: Fix initramfs size calculation Hendrik Brueckner
2010-08-25 20:10 ` [PATCH] " H. Peter Anvin
2010-08-26 8:46 ` Michael Holzheu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282812947.1879.17.camel@holzheu-laptop \
--to=holzheu@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=brueckner@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=sam@ravnborg.org \
--cc=schwidefsky@de.ibm.com \
--cc=tabbott@ksplice.com \
--cc=vda.linux@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®