Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3756990imj; Tue, 12 Feb 2019 04:13:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMcPzjUemfgQ6TFts5qYFEIvWzUBdPLpFYM3k7C+QKDRQntPC9TPGXOvHf+SnS3Dp+vu0M X-Received: by 2002:a63:3541:: with SMTP id c62mr3366945pga.191.1549973619392; Tue, 12 Feb 2019 04:13:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549973619; cv=none; d=google.com; s=arc-20160816; b=rVUFmfp+5izB5lReQwxwM1offLLDZ74dTq/Q/86f1cTj2YTHrv8vWGq01JNkvsx2/J rMlLYihXxJMS5a7V3ACpGyK2I8j96E3Z7t1lQkSalCeAytqdQede2XZLtSe24+RPZrNq 7tFetETeeKRItYDgHZDufnV4K0F/6y8Cr9J+Zbz7VH9gk3pFPa1sJVCfarLMpsfiKalV ZQxZOQ4ZS9/8TzMbMSY3Jx4NoAM+4pN+U/l4KMpIDNosMex9iMEtOxIGqb8hYV4CInQp DUFRGeL8i9mADAQjiUuEe3vZ2pFCdN+CX1SPU/nZr58HT32zj0pXdZXp4i4CVtbbSJ9Z U0ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject; bh=TeiWiswV2hae7RzTaCk77GoilWcHI9feGIUuJIdOug4=; b=xpK3gQu8OuRWPSXv42lHsTjLS9bHjhaL05NPklhbElpdUxrOzkYZklS6wGvzqIqiw+ g+4aoQLp6CNLvGl46MCCk+e58idp/+xyl6J1LHAT5ljBA4ieX7Da5qXCMUs3haDS92n4 AuWgxdJmB/IpWJmS+lljarReU2Qpb+WjmSrrQzfqQ95EpItwow0/mHx8QR+uKpip6gqa 6Hz9DKJTTZ6Qv1D4itbtBfUt795cK/Fcnq4W9qHVOXgSujBXCk3WmdpdlmuGF8QXoNtj ZOrjdubNWejAIt0BMATrY1BYiFgtx+zkhcVRrrE7sZbOn2NZA+kXA5Dbwm0vKCcbCuzm en/g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si13428913plb.8.2019.02.12.04.13.23; Tue, 12 Feb 2019 04:13:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729051AbfBLMMx (ORCPT + 99 others); Tue, 12 Feb 2019 07:12:53 -0500 Received: from mail.sysgo.com ([176.9.12.79]:42090 "EHLO mail.sysgo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726565AbfBLMMw (ORCPT ); Tue, 12 Feb 2019 07:12:52 -0500 Subject: Re: [PATCH RESEND] initramfs: cleanup incomplete rootfs To: Andy Shevchenko , Andrew Morton Cc: Dominik Brodowski , Greg Kroah-Hartman , Philippe Ombredanne , Arnd Bergmann , Luc Van Oostenryck , Linux Kernel Mailing List 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> From: David Engraf Message-ID: Date: Tue, 12 Feb 2019 13:12:48 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12.02.19 at 11:43, Andy Shevchenko wrote: > 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. The problem is that the kernel expects another archive if there are data left. If these data do not contain a valid magic the kernel prints an error message which is correct. I could make this error not critical and keep the rootfs, but it's still an error and unexpected. You're using a modified bootloader which reports a size larger than the file itself. Other bootloader will use the file size and report the correct size to the kernel. So this workaround is required by your setup only. @Andrew: What do you think about that? Shall I create a workaround for the special case? Best regards - David