All of lore.kernel.org
 help / color / mirror / Atom feed
From: viro@ZenIV.linux.org.uk (Al Viro)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] initramfs: finish fput() before accessing any binary from initramfs
Date: Wed, 1 Feb 2017 12:28:38 +0000	[thread overview]
Message-ID: <20170201122838.GC27291@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20170124053636.30121-1-lokeshvutla@ti.com>

On Tue, Jan 24, 2017 at 11:06:36AM +0530, Lokesh Vutla wrote:
> commit 4a9d4b024a31 ("switch fput to task_work_add") implements a
> schedule_work() for completing fput(), but did not guarantee calling
> __fput() after unpacking initramfs. Because of this, there is a
> possibility that during boot a driver can see ETXTBSY when it tries
> to load a binary from initramfs as fput() is still pending on that
> binary. This patch makes sure that fput() is completed after unpacking
> initramfs.

Umm...  Do we want it done in kernel_init(), then?  I have no objections
against calling it in populate_rootfs(), and it looks like a sane place
for that, but I wonder if the old callsite would remain needed after that...

WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Lokesh Vutla <lokeshvutla@ti.com>
Cc: linux-kernel@vger.kernel.org,
	Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>,
	Tero Kristo <t-kristo@ti.com>, Sekhar Nori <nsekhar@ti.com>,
	Nishanth Menon <nm@ti.com>,
	Muralidharan Karicheri <m-karicheri2@ti.com>
Subject: Re: [PATCH v2] initramfs: finish fput() before accessing any binary from initramfs
Date: Wed, 1 Feb 2017 12:28:38 +0000	[thread overview]
Message-ID: <20170201122838.GC27291@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20170124053636.30121-1-lokeshvutla@ti.com>

On Tue, Jan 24, 2017 at 11:06:36AM +0530, Lokesh Vutla wrote:
> commit 4a9d4b024a31 ("switch fput to task_work_add") implements a
> schedule_work() for completing fput(), but did not guarantee calling
> __fput() after unpacking initramfs. Because of this, there is a
> possibility that during boot a driver can see ETXTBSY when it tries
> to load a binary from initramfs as fput() is still pending on that
> binary. This patch makes sure that fput() is completed after unpacking
> initramfs.

Umm...  Do we want it done in kernel_init(), then?  I have no objections
against calling it in populate_rootfs(), and it looks like a sane place
for that, but I wonder if the old callsite would remain needed after that...

  parent reply	other threads:[~2017-02-01 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24  5:36 [PATCH v2] initramfs: finish fput() before accessing any binary from initramfs Lokesh Vutla
2017-01-24  5:36 ` Lokesh Vutla
2017-02-01  9:24 ` Lokesh Vutla
2017-02-01  9:24   ` Lokesh Vutla
2017-02-01 12:28 ` Al Viro [this message]
2017-02-01 12:28   ` Al Viro
2017-02-01 13:45   ` Lokesh Vutla
2017-02-01 13:45     ` Lokesh Vutla

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=20170201122838.GC27291@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.