linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Menglong Dong <menglong8.dong@gmail.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Jens Axboe <axboe@kernel.dk>,
	hare@suse.de, gregkh@linuxfoundation.org, tj@kernel.org,
	Menglong Dong <dong.menglong@zte.com.cn>,
	song@kernel.org, NeilBrown <neilb@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	wangkefeng.wang@huawei.com, f.fainelli@gmail.com, arnd@arndb.de,
	Barret Rhoden <brho@google.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	mhiramat@kernel.org, Steven Rostedt <rostedt@goodmis.org>,
	Kees Cook <keescook@chromium.org>,
	vbabka@suse.cz, Alexander Potapenko <glider@google.com>,
	pmladek@suse.com, Chris Down <chris@chrisdown.name>,
	ebiederm@xmission.com, jojing64@gmail.com,
	LKML <linux-kernel@vger.kernel.org>,
	palmerdabbelt@google.com, linux-fsdevel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH RESEND] init/initramfs.c: make initramfs support pivot_root
Date: Tue, 25 May 2021 14:09:08 +0800	[thread overview]
Message-ID: <CADxym3bbx7pXahoRb98ocQb1JYQMdagYDJ+XKe_RwD=7c6MCug@mail.gmail.com> (raw)
In-Reply-To: <20210525014304.GH4332@42.do-not-panic.com>

On Tue, May 25, 2021 at 9:43 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> >
> > This change seems transparent to users, which don't change the behavior
> > of initramfs.
>
> Are we sure there nothing in the kernel that can regress with this
> change? Are you sure? How sure?
>
> > However, it seems more reasonable to make it a kconfig option.
> > I'll do it in the v2 of the three patches I sended.
>
> I'm actually quite convinced now this is a desirable default *other*
> than the concern if this could regress. I recently saw some piece of
> code fetching for the top most mount, I think it was on the
> copy_user_ns() path or something like that, which made me just
> consider possible regressions for heuristics we might have forgotten
> about.
>
> I however have't yet had time to review the path I was concerned for
> yet.

Yeah, I'm sure...probably. The way I create and mount 'user root' is
almost the same to block root device. When it comes to block
device, such as hda, what kernel do is:

/* This will mount block device on '/root' and chdir to '/root' */
prepare_namespace->mount_root->mount_block_root->do_mount_root;

/* This will move the block device mounted on '/root' to '/' */
init_mount(".", "/", NULL, MS_MOVE, NULL);

/* This will change the root to current dir, which is the root of block
 * device.
 */
init_chroot(".")

And these steps are exactly what I do with 'user root'. However, I'm
not totally sure. For safety, I'll make it into a kconfig option. Is
it acceptable to make it enabled by default?

Thanks!
Menglong Dong

      reply	other threads:[~2021-05-25  6:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 15:42 [PATCH RESEND] init/initramfs.c: make initramfs support pivot_root menglong8.dong
2021-05-20 21:41 ` Luis Chamberlain
2021-05-21  0:41   ` Menglong Dong
2021-05-21 15:50     ` Luis Chamberlain
2021-05-22  4:09       ` Menglong Dong
2021-05-24 22:58         ` Luis Chamberlain
2021-05-25  0:55           ` Menglong Dong
2021-05-25  1:43             ` Luis Chamberlain
2021-05-25  6:09               ` Menglong Dong [this message]

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='CADxym3bbx7pXahoRb98ocQb1JYQMdagYDJ+XKe_RwD=7c6MCug@mail.gmail.com' \
    --to=menglong8.dong@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=brho@google.com \
    --cc=chris@chrisdown.name \
    --cc=dong.menglong@zte.com.cn \
    --cc=ebiederm@xmission.com \
    --cc=f.fainelli@gmail.com \
    --cc=glider@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=jack@suse.cz \
    --cc=jojing64@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=neilb@suse.de \
    --cc=palmerdabbelt@google.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=song@kernel.org \
    --cc=tj@kernel.org \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wangkefeng.wang@huawei.com \
    /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).