From: <gregkh@linuxfoundation.org>
To: shorne@gmail.com, gregkh@linuxfoundation.org, lokeshvutla@ti.com,
viro@zeniv.linux.org.uk
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "initramfs: Always do fput() and load modules after rootfs populate" has been added to the 4.11-stable tree
Date: Thu, 18 May 2017 09:45:36 +0200 [thread overview]
Message-ID: <1495093536223245@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
initramfs: Always do fput() and load modules after rootfs populate
to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
initramfs-always-do-fput-and-load-modules-after-rootfs-populate.patch
and it can be found in the queue-4.11 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 17a9be31747535184f2af156b1f080ec4c92a952 Mon Sep 17 00:00:00 2001
From: Stafford Horne <shorne@gmail.com>
Date: Thu, 4 May 2017 21:15:56 +0900
Subject: initramfs: Always do fput() and load modules after rootfs populate
From: Stafford Horne <shorne@gmail.com>
commit 17a9be31747535184f2af156b1f080ec4c92a952 upstream.
In OpenRISC we do not have a bootloader passed initrd, but the built in
initramfs does contain the /init and other binaries, including modules.
The previous commit 08865514805d2 ("initramfs: finish fput() before
accessing any binary from initramfs") made a change to only call fput()
if the bootloader initrd was available, this caused intermittent crashes
for OpenRISC.
This patch changes the fput() to happen unconditionally if any rootfs is
loaded. Also, I added some comments to make it a bit more clear why we
call unpack_to_rootfs() multiple times.
Fixes: 08865514805d2 ("initramfs: finish fput() before accessing any binary from initramfs")
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
init/initramfs.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -608,9 +608,11 @@ static void __init clean_rootfs(void)
static int __init populate_rootfs(void)
{
+ /* Load the built in initramfs */
char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
if (err)
panic("%s", err); /* Failed to decompress INTERNAL initramfs */
+ /* If available load the bootloader supplied initrd */
if (initrd_start) {
#ifdef CONFIG_BLK_DEV_RAM
int fd;
@@ -648,13 +650,14 @@ static int __init populate_rootfs(void)
printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
free_initrd();
#endif
- flush_delayed_fput();
- /*
- * Try loading default modules from initramfs. This gives
- * us a chance to load before device_initcalls.
- */
- load_default_modules();
}
+ flush_delayed_fput();
+ /*
+ * Try loading default modules from initramfs. This gives
+ * us a chance to load before device_initcalls.
+ */
+ load_default_modules();
+
return 0;
}
rootfs_initcall(populate_rootfs);
Patches currently in stable-queue which might be from shorne@gmail.com are
queue-4.11/initramfs-always-do-fput-and-load-modules-after-rootfs-populate.patch
queue-4.11/initramfs-avoid-label-at-end-of-compound-statement-error.patch
reply other threads:[~2017-05-18 7:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1495093536223245@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=lokeshvutla@ti.com \
--cc=shorne@gmail.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).