linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org,
	Steven Price <steven.price@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 4.19] Revert "initramfs: free initrd memory if opening /initrd.image fails"
Date: Tue, 06 Aug 2019 14:36:45 -0700	[thread overview]
Message-ID: <5d49f2ee.1c69fb81.881ec.1cf7@mx.google.com> (raw)
In-Reply-To: <20190806204752.GG17747@sasha-vm>

Quoting Sasha Levin (2019-08-06 13:47:52)
> On Tue, Aug 06, 2019 at 10:59:40AM -0700, Stephen Boyd wrote:
> >This reverts commit 25511676362d8f7d4b8805730a3d29484ceab1ec in the 4.19
> >stable trees. From what I can tell this commit doesn't do anything to
> >improve the situation, mostly just reordering code to call free_initrd()
> >from one place instead of many. In doing that, it causes free_initrd()
> >to be called even in the case when there isn't an initrd present. That
> >leads to virtual memory bugs that manifest on arm64 devices.
> >
> >The fix has been merged upstream in commit 5d59aa8f9ce9 ("initramfs:
> >don't free a non-existent initrd"), but backporting that here is more
> >complicated because the patch is stacked upon this patch being reverted
> >along with more patches that rewrites the logic in this area.
> >
> >Let's just revert the patch from the stable tree instead of trying to
> >backport a collection of fixes to get the final fix from upstream.
> 
> The only dependency for taking the fix, 5d59aa8f9ce9, into 4.19 is
> 23091e28735 ("initramfs: cleanup initrd freeing") which is not too
> scary.
> 
> Is it the case that 25511676362d8 shouldn't have been backported to 4.19
> for some reason? If it fixes something on 4.19, I think it's better to
> take the dependency and the fix instead of reverting.
> 

Ah thanks for taking a second look. I missed that we call free_initrd()
in one more case when unpack_to_rootfs() fails and goes into the else
statement. I suppose bringing in 23091e28735 ("initramfs: cleanup initrd
freeing") in addition to 5d59aa8f9ce9 works just as well, but I'll defer
to the persons working in this area.


  reply	other threads:[~2019-08-06 21:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 17:59 [PATCH 4.19] Revert "initramfs: free initrd memory if opening /initrd.image fails" Stephen Boyd
2019-08-06 20:47 ` Sasha Levin
2019-08-06 21:36   ` Stephen Boyd [this message]
2019-08-07 11:53     ` Steven Price

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=5d49f2ee.1c69fb81.881ec.1cf7@mx.google.com \
    --to=swboyd@chromium.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=steven.price@arm.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;
as well as URLs for NNTP newsgroup(s).