From: zohar@linux.vnet.ibm.com (Mimi Zohar)
To: linux-security-module@vger.kernel.org
Subject: [RFC PATCH] rootfs: force mounting rootfs as tmpfs
Date: Wed, 31 Jan 2018 17:07:03 -0500 [thread overview]
Message-ID: <1517436423.3469.237.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <1814af5c-170d-39c0-58fd-02eb7216e008@landley.net>
On Wed, 2018-01-31 at 13:32 -0600, Rob Landley wrote:
> On 01/30/2018 03:46 PM, Mimi Zohar wrote:
> > Commit 16203a7a9422 ("initmpfs: make rootfs use tmpfs when CONFIG_TMPFS
> > enabled") introduced using tmpfs as the rootfs filesystem. The use of
> > tmpfs is limited to systems that do not specify "root=" on the boot
> > command line.
> >
> > Without the check "!saved_root_name[0]", rootfs uses tmpfs. As there
> > must be a valid reason for this check, this patch introduces a new boot
> > command line option named "noramfs" to force rootfs to use tmpfs.
> >
> > Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
>
> How about just:
>
> diff --git a/init/do_mounts.c b/init/do_mounts.c
> index 7cf4f6d..af66ede 100644
> --- a/init/do_mounts.c
> +++ b/init/do_mounts.c
> @@ -632,8 +632,8 @@ int __init init_rootfs(void)
> if (err)
> return err;
>
> - if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] &&
> - (!root_fs_names || strstr(root_fs_names, "tmpfs"))) {
> + if (IS_ENABLED(CONFIG_TMPFS) && (!saved_root_name[0] ||
> + !strcmp(saved_root_name, "tmpfs"))) {
> err = shmem_init();
> is_tmpfs = true;
> } else {
>
> (Obviously-signed-off-by: Rob Landley <rob@landley.net>)
>
> I.E. if you somehow just can't stop yourself from specifying root= when
> using rootfs, have "root=tmpfs" do what you want.
I tried overloading "rootfstype=tmpfs", before posting this work
around, but for some reason that just doesn't work.
>
> (The old "I configured in tmpfs and am using rootfs but I want that rootfs
> to be ramfs, not tmpfs" code doesn't seem to be a real-world concern, does
> it?)
I must be missing something. ?Which systems don't specify "root=" on
the boot command line. ?If we want to include and restore xattrs,
there needs to be a way of using tmpfs.
Mimi
>
> > ---
> > Documentation/admin-guide/kernel-parameters.txt | 2 ++
> > init/do_mounts.c | 15 +++++++++++++--
> > 2 files changed, 15 insertions(+), 2 deletions(-)
>
> I suppose I should do a documentation update too. Lemme send a proper one
> after work...
>
> Rob
>
> P.S. While I'm at it, I've meant to wire up rootflags= so you can specify
> a memory limit other than 50% forever, I should do that too. And resend
> my "make DEVTMPFS_MOUNT apply to initramfs" patch (with the debian bug
> workaround)...
>
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-01-31 22:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 21:46 [RFC PATCH] rootfs: force mounting rootfs as tmpfs Mimi Zohar
2018-01-31 19:32 ` Rob Landley
2018-01-31 22:07 ` Mimi Zohar [this message]
2018-01-31 23:48 ` Rob Landley
2018-02-01 2:03 ` Arvind Sankar
2018-02-01 4:22 ` Mimi Zohar
2018-02-01 15:20 ` Rob Landley
2018-02-01 15:55 ` Mimi Zohar
2018-02-01 17:09 ` Rob Landley
2018-02-01 21:51 ` Mimi Zohar
2018-02-01 22:41 ` Taras Kondratiuk
2018-02-01 23:34 ` Rob Landley
2018-04-16 15:46 ` Mimi Zohar
2018-02-01 22:46 ` Rob Landley
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=1517436423.3469.237.camel@linux.vnet.ibm.com \
--to=zohar@linux.vnet.ibm.com \
--cc=linux-security-module@vger.kernel.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 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).