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: <CADxym3YWUBf6W4pgeSPuYKFXPXeGse0t=DW8fAm-3WvgjWkRnA@mail.gmail.com>
Date:   Thu, 3 Jun 2021 23:05:08 +0800
From:   Menglong Dong <menglong8.dong@...il.com>
To:     Christian Brauner <christian.brauner@...ntu.com>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        Kees Cook <keescook@...omium.org>,
        Sami Tolvanen <samitolvanen@...gle.com>, johan@...nel.org,
        ojeda@...nel.org, Andrew Morton <akpm@...ux-foundation.org>,
        Menglong Dong <dong.menglong@....com.cn>, masahiroy@...nel.org,
        joe@...ches.com, hare@...e.de, Jens Axboe <axboe@...nel.dk>,
        Jan Kara <jack@...e.cz>, tj@...nel.org,
        gregkh@...uxfoundation.org, song@...nel.org,
        NeilBrown <neilb@...e.de>, Barret Rhoden <brho@...gle.com>,
        Luis Chamberlain <mcgrof@...nel.org>, palmerdabbelt@...gle.com,
        arnd@...db.de, f.fainelli@...il.com,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        wangkefeng.wang@...wei.com, Masami Hiramatsu <mhiramat@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>, vbabka@...e.cz,
        pmladek@...e.com, Alexander Potapenko <glider@...gle.com>,
        Chris Down <chris@...isdown.name>,
        "Eric W. Biederman" <ebiederm@...ssion.com>, jojing64@...il.com,
        mingo@...nel.org, terrelln@...com, geert@...ux-m68k.org,
        linux-fsdevel@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        jeyu@...nel.org, Bjorn Helgaas <bhelgaas@...gle.com>,
        Josh Triplett <josh@...htriplett.org>
Subject: Re: [PATCH v4 2/3] init/do_mounts.c: create second mount for initramfs

On Thu, Jun 3, 2021 at 9:30 PM Christian Brauner
<christian.brauner@...ntu.com> wrote:
>
[...]
>
> In fact you seem to be only using this struct you're introducing in this
> single place which makes me think that it's not needed at all. So what's
> preventing us from doing:
>
> > +
> > +     return do_mount_root(root->dev_name,
> > +                          root->fs_name,
> > +                          root_mountflags & ~MS_RDONLY,
> > +                          root_mount_data);
> > +}
>
> int __init prepare_mount_rootfs(void)
> {
>         if (is_tmpfs_enabled())
>                 return do_mount_root("tmpfs", "tmpfs",
>                                      root_mountflags & ~MS_RDONLY,
>                                      root_mount_data);
>
>         return do_mount_root("ramfs", "ramfs",
>                              root_mountflags & ~MS_RDONLY,
>                              root_mount_data);
> }

It seems to make sense, but I just feel that it is a little hardcode.
What if a new file system
of rootfs arises? Am I too sensitive?

[...]
>
> This is convoluted imho. I would simply use two tiny helpers:
>
> void __init finish_mount_rootfs(void)
> {
>         init_mount(".", "/", NULL, MS_MOVE, NULL);
>
>         if (ramdisk_exec_exist())
>                 init_chroot(".");
> }
>
> void __init revert_mount_rootfs(void)
> {
>         init_chdir("/");
>         init_umount(".", 0);
> }
>

This looks nice.


Thanks!
Menglong Dong

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ