LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: David Engraf <david.engraf@sysgo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] initramfs: cleanup incomplete rootfs
Date: Tue, 12 Feb 2019 12:43:17 +0200	[thread overview]
Message-ID: <CAHp75VcNY3ZX9XF10mmOGgRq=-Soa+a0y=iFC0c+S=gzJ0+2RQ@mail.gmail.com> (raw)
In-Reply-To: <84d387a3-0519-d50b-2c5d-98c10f694376@sysgo.com>

On Mon, Feb 11, 2019 at 2:40 PM David Engraf <david.engraf@sysgo.com> wrote:
> On 11.02.19 at 12:40, Andy Shevchenko wrote:
> > On Mon, Feb 11, 2019 at 10:49 AM David Engraf <david.engraf@sysgo.com> wrote:
> >> On 11.02.19 at 08:56, David Engraf wrote:
> >>> On 09.02.19 at 11:35, Andy Shevchenko wrote:
> >>>> On Sat, Feb 9, 2019 at 12:08 AM Andrew Morton
> >>>> <akpm@linux-foundation.org> wrote:
> >>>>> On Fri, 8 Feb 2019 21:45:21 +0200 Andy Shevchenko
> >>>>> <andy.shevchenko@gmail.com> wrote:
> >>>>>> On Tue, Oct 30, 2018 at 5:22 PM David Engraf
> >>>>>> <david.engraf@sysgo.com> wrote:

> >>>> In my case I have got "Junk in compressed archive". I don't know (I
> >>>> would check if needed) which exact condition I got  since there are
> >>>> three places with this message. The file itself smaller than the size
> >>>> passed through bootparam. So, when decomression is finished
> >>>> (successfully!) we still have a garbarge in the memory which is not
> >>>> related to archive. Message per se is okay to have, though I consider
> >>>> this non-fatal.
> >>>
> >>> I can reproduce this special case. The unpacking decompresses the whole
> >>> size instead of checking the archive size. I will have a look how to get
> >>> the real archive size.
> >>
> >> I did some checks and manually increased the initramfs size but I always
> >> get the following kernel panic:
> >
> > We need to be on the same page here.
> > There are two sizes of initramfs compressed archive:
> >   1) actual file size;
> >   2) what is declared by boot loader and provided via boot parameters.
> >
> > In my case I have the 2) bigger than the actual file size.
> > Kernel decompresses the initramfs, prints an error that there is junk,
> > which is understandable and continues to run init, etc.
>
> Ok got it. When the memory behind the actual file size is clear (0x0)
> the decompression doesn't complain and just ignores the padding. Any
> other data will be interpreted as a new archive and thus you'll see the
> error message.

Correct.

> Is it possible for you to fill the padding after the actual file size
> with 0x00 ?

Not sure. This is boot loader realm. Even if I patch U-Boot, not every
boot loader will guarantee this.
So, it's fragile to rely on data being 0x00 after actual archive.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2019-02-12 10:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 13:40 [PATCH] " David Engraf
2018-10-30 15:18 ` [PATCH RESEND] " David Engraf
2019-02-08 19:45   ` Andy Shevchenko
2019-02-08 22:08     ` Andrew Morton
2019-02-09 10:35       ` Andy Shevchenko
2019-02-11  7:56         ` David Engraf
2019-02-11  8:49           ` David Engraf
2019-02-11 11:40             ` Andy Shevchenko
2019-02-11 12:40               ` David Engraf
2019-02-12 10:43                 ` Andy Shevchenko [this message]
2019-02-12 12:12                   ` David Engraf
2019-02-12 13:50                     ` Andy Shevchenko
2019-02-15 20:13                       ` Andy Shevchenko
2019-02-12  0:56         ` Andrew Morton
2019-02-12  8:04           ` David Engraf

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='CAHp75VcNY3ZX9XF10mmOGgRq=-Soa+a0y=iFC0c+S=gzJ0+2RQ@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=david.engraf@sysgo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=pombredanne@nexb.com \
    --subject='Re: [PATCH RESEND] initramfs: cleanup incomplete rootfs' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).