Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3672804imj; Tue, 12 Feb 2019 02:45:23 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib2BG10/4IYQfYLYc3tdpcyeV4/Oj5NpDgpm0k/cW9sZJRmjVW51flOrtkJTUYDAIE0J+Xo X-Received: by 2002:a63:da18:: with SMTP id c24mr3028207pgh.318.1549968322981; Tue, 12 Feb 2019 02:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549968322; cv=none; d=google.com; s=arc-20160816; b=SZ4KvOxk8mZz5TIcHNNpTccGfrZmgfccHtES+txhs/fG5pDvjfOW2aYP2x1KHieZ+8 5VQ98tnKy655g8qV+vW+ayBrMxb+a9ZX4zEa/0D0TNfH0OARUNBGZB8AqXCP88Yay1Fc 7C1qZVIVwTPVKCP9nSC2kHdShnEVyiJlilKMqn69TQ6tM8+Rl29sxuj66C8QePiJwfcY M8oxLHeT5x0Iykpj0MLV67c6aX24YPFsWO+/+9mph5Mo1Nru/vpKmxa8pE2Wk1VUNJJ4 YK0yS8AqFYRPo6C+8w+7CrbndBoefybjAndphYGD/k8Gt5AzOHDNFg6meWp9Mc8mcbYh AF9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=d8P5exSs3twRu8zJ2gtuZfvW2NKZTCWFQj3xG9H1nIU=; b=UD/bVYUqcTi0PEEayM5Fewca5wz6YB9bpNntZPbiFWq8MaDEFjm2VMGUXlkxFItCa+ vke5LeC4ZRSM/F1AKSuTFMK2doZN7rDBjoUu6x7TbkKQE1zjGs+TycDHzqvbuX997l3m /hEJ0pOPXd24MuWyMyPQNF1+x8tGmUYQsMSXo36nmCeJlWiiuQCz2d6e3GnOJ0oI3+9p 29lbfzunOskA2ViK6II0QVvBR0H8od1B85JTkNe+KXf7WdtY4dslIy/Q/dN9+96uXqvS XTRr+5XvCWlOwpKeUMvk2BekQQ0JmG8IQmOWn5ohRFgjvT7sspBw0G6aq1msm9PxtWEx 01+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="UVh/iEVP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si7501931ply.246.2019.02.12.02.45.07; Tue, 12 Feb 2019 02:45:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="UVh/iEVP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbfBLKn3 (ORCPT + 99 others); Tue, 12 Feb 2019 05:43:29 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33545 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728184AbfBLKn3 (ORCPT ); Tue, 12 Feb 2019 05:43:29 -0500 Received: by mail-pl1-f193.google.com with SMTP id y10so1129147plp.0 for ; Tue, 12 Feb 2019 02:43:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d8P5exSs3twRu8zJ2gtuZfvW2NKZTCWFQj3xG9H1nIU=; b=UVh/iEVPwNezCaXex4J5FZNwyI6kKR3cyRbivC5V5yUzSTdLaTzQN7uiqvfjBoOJ4P bf1ZET5GbfjdADM+YQNaHIcTDhJirWlEzcW65t51d2QeTlx3fEl2sP2h5IBwZpzIgmp2 6/nBGoh61HssAOOikewx9TUaUmaoyFpP4tGrWZJkSdnE0pVqOhRM7+NWdvWgtx/2QpDW SohtYbrMfsx/OLw+hRoiNurMsRdrpv1diznijsU7R3FnPNrecWaJMqrDWXbMQEf2mUqV 9p/dQAyQfh+SUYo7+aiCZiLzsTMqN0uix1P7stosVhTVW488eQ4V2hwFsC25Ge5boFnZ +MRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d8P5exSs3twRu8zJ2gtuZfvW2NKZTCWFQj3xG9H1nIU=; b=sD7pdF51YvblaCjapOMBM0etZWpb5UMDUZBf8YhsUbYf2rgVnhPlooZWl3qtPkEhKH wGicdmZz/YkEASJn9kMFlM2kgQ3OLs49zqngiRSt0DogmCnHC3KfAq0y2oH+MaKyOEhZ j7XhBEm/EsnTbsfuYzs55CWZEdr9/7K0aK7pyinXTFzO1p89leVrgOMszeRT3TUKEej3 w5nhF36NC0KzzPcHt4rB5LgsHh0BiSX6WIxV00bofhmBiDgpgQaK2uyUndZEUUhG1Qfk ARhrvGxjyxABhi8EzjUVVzULrMFaMXUp9Sq//m/WbXratwZWt7iHLX6JLJaoHRA+mm3U ztoA== X-Gm-Message-State: AHQUAub9WcCFJshV77cXL+nxfRIZ/csDMQtU6V7nrk8XvNErim+r6CrF CUUV4xLwNk6lUvPIlh4a3Xb3+9Cb8bXfqYVF+Q/4Cvv6 X-Received: by 2002:a17:902:bc88:: with SMTP id bb8mr3416368plb.12.1549968208706; Tue, 12 Feb 2019 02:43:28 -0800 (PST) MIME-Version: 1.0 References: <20181022134048.19693-1-david.engraf@sysgo.com> <20181030151805.5519-1-david.engraf@sysgo.com> <20190208140810.76ef6c25825a5644d9625f0a@linux-foundation.org> <744e7bcb-9315-0283-67c5-c2cb2d094251@sysgo.com> <28139206-7fed-e00e-8f52-47e68655963d@sysgo.com> <84d387a3-0519-d50b-2c5d-98c10f694376@sysgo.com> In-Reply-To: <84d387a3-0519-d50b-2c5d-98c10f694376@sysgo.com> From: Andy Shevchenko Date: Tue, 12 Feb 2019 12:43:17 +0200 Message-ID: Subject: Re: [PATCH RESEND] initramfs: cleanup incomplete rootfs To: David Engraf Cc: Andrew Morton , Dominik Brodowski , Greg Kroah-Hartman , Philippe Ombredanne , Arnd Bergmann , Luc Van Oostenryck , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 11, 2019 at 2:40 PM David Engraf wrote: > On 11.02.19 at 12:40, Andy Shevchenko wrote: > > On Mon, Feb 11, 2019 at 10:49 AM David Engraf 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 > >>>> wrote: > >>>>> On Fri, 8 Feb 2019 21:45:21 +0200 Andy Shevchenko > >>>>> wrote: > >>>>>> On Tue, Oct 30, 2018 at 5:22 PM David Engraf > >>>>>> 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