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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fb776d99-1956-4e1b-9afc-84f27ca40f46@linux.ibm.com>
Date: Fri, 29 Dec 2023 11:39:14 -0500
From: Stefan Berger <stefanb@...ux.ibm.com>
To: Askar Safin <safinaskar@...il.com>, Rob Landley <rob@...dley.net>
Cc: gregkh@...uxfoundation.org, initramfs@...r.kernel.org,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        zohar@...ux.ibm.com
Subject: Re: [PATCH v3] rootfs: Fix support for rootfstype= when root= is
 given



On 12/21/23 17:58, Askar Safin wrote:
> Hi, Rob. And Stefan.
> 
> First of all, this patch got to linux-next (
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?qt=author&q=Stefan+Berger
> ), so it seems it soon will be in mainline.
> 
> On Thu, Dec 21, 2023 at 12:24 PM Rob Landley <rob@...dley.net> wrote:
>> Can you build tmpfs on a nommu system? Last I checked the plumbing expects swap,
>> but it's been a while...
> Okay, I agree, let's not remove ramfs.
> 
> Still, I don't like this (already applied) patch. init= and rdinit=
> are two different options, and this is good. So, I think we should
> have two different options. Analogously they should be rootfstype= and
> rdrootfstype=. rootfstype= should be read by kernel when deciding how
> to mount real root (i. e. not initramfs or initrd) only and
> rdrootfstype= when deciding how to mount initramfs only. This will
> make everything cleaner. Also note that userspace tools read
> rootfstype= and assume that it always applies to real root. For
> example, this is Debian's rdinit:
> 
> https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/cf964bfb4362019fd7fba1e839e403ff950dca8e/init#L103
> 
> As you can see, this shell script parses /proc/cmdline and assumes
> that rootfstype= always applies to real root. So, if someone sets
> rootfstype= to tmpfs or ramfs, this will likely break this script.

Setting the kernel boot command line option rootfstype= to tmpfs or 
ramfs was possible so far and that's what the documentation and code 
supported so far as well. The bug surfaced when root= was provided, in 
which case it was ignored.

> 
> So, I think the code should look so:
> 
> +if (IS_ENABLED(CONFIG_TMPFS)) {
> +        if (!rd_root_fs_names) // We assume rd_root_fs_names is set
> by rdrootfstype=
> +                is_tmpfs = true; // Use tmpfs if rdrootfstype= is not
> set. To get all tmpfs benefits
> +        else if (rd_root_fs_names && !!strstr(rd_root_fs_names, "tmpfs"))
> +                is_tmpfs = true;
> +}
> 
> Yes, this will slightly break compatibility. I. e. this will make
> Linux always choose tmpfs if rdrootfstype= is not present. But I think

You may find someone who doesn't like this change, either, ...

> there is nothing wrong with it. If a user cares, he will set
> rdrootfstype= . And early boot code will become a lot more clean and
> logical.
> 
> Rob, do you agree? Stefan, do you agree? Then I will write a patch,

... but go ahead.

> with doc changes (currently I use gmail web interface, of course I
> will use git send-email when I sent actual patch)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ