lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231031154417.621742-1-stefanb@linux.ibm.com>
Date:   Tue, 31 Oct 2023 11:44:17 -0400
From:   Stefan Berger <stefanb@...ux.ibm.com>
To:     linux-kernel@...r.kernel.org
Cc:     Stefan Berger <stefanb@...ux.ibm.com>,
        "Milton D. Miller II" <mdmii@...look.com>,
        Rob Landley <rob@...dley.net>,
        Jeff Layton <jlayton@...nel.org>, Jens Axboe <axboe@...nel.dk>,
        Jim Cromie <jim.cromie@...il.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Eric W. Biederman" <ebiederm@...ssion.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        "H. Peter Anvin" <hpa@...or.com>, Mimi Zohar <zohar@...ux.ibm.com>
Subject: [RFC PATCH] rootfs: Use tmpfs for rootfs even if root= is given

rootfs currently does not use tmpfs if the root= boot option is passed
even though the documentation about rootfs (added in 6e19eded3684) in
Documentation/filesystems/ramfs-rootfs-initramfs.rst states:

  If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by
  default.  To force ramfs, add "rootfstype=ramfs" to the kernel command
  line.

However, this currently does not work when root= is passed on the boot
command line since then saved_root_name contains a string and prevents
usage of tmpfs. Therefore, remove the check on saved_root_name to
enable tmpfs for rootfs.

Fixes: 6e19eded3684 ("initmpfs: use initramfs if rootfstype= or root= specified")
Signed-off-by: Stefan Berger <stefanb@...ux.ibm.com>
Cc: "Milton D. Miller II" <mdmii@...look.com>
Cc: Rob Landley <rob@...dley.net>
Cc: Jeff Layton <jlayton@...nel.org>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: Jim Cromie <jim.cromie@...il.com>
Cc: Sam Ravnborg <sam@...nborg.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Mimi Zohar <zohar@...ux.ibm.com>
---
 init/do_mounts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 5dfd30b13f48..6567cf5807ee 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -510,7 +510,7 @@ struct file_system_type rootfs_fs_type = {
 
 void __init init_rootfs(void)
 {
-	if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] &&
+	if (IS_ENABLED(CONFIG_TMPFS) &&
 		(!root_fs_names || strstr(root_fs_names, "tmpfs")))
 		is_tmpfs = true;
 }
-- 
2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ