From: Michael Ellerman <mpe@ellerman.id.au>
To: Rob Landley <rob@landley.net>, Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Prarit Bhargava <prarit@redhat.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Yang Shi <yang.shi@linaro.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Kees Cook <keescook@chromium.org>,
Emese Revfy <re.emese@gmail.com>, Petr Mladek <pmladek@suse.com>,
Fabian Frederick <fabf@skynet.be>
Subject: Re: [PATCHv2] Make initramfs honor CONFIG_DEVTMPFS_MOUNT
Date: Wed, 17 May 2017 13:58:34 +1000 [thread overview]
Message-ID: <87ziecnnh1.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <21935caf-501d-e97c-5611-5c4af7e0f9ae@landley.net>
Rob Landley <rob@landley.net> writes:
> diff --git a/init/main.c b/init/main.c
> index f866510..9ec09ff 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -1055,8 +1049,17 @@ static noinline void __init kernel_init_freeable(void)
> if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
> ramdisk_execute_command = NULL;
> prepare_namespace();
> + } else if (IS_ENABLED(CONFIG_DEVTMPFS_MOUNT)) {
> + sys_mkdir("/dev", 0755);
> + devtmpfs_mount("/dev");
> }
>
> + /* Open the /dev/console on the rootfs, this should never fail */
> + if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
Sorry to pile on, but while you're moving it do you want to update this
fairly misleading comment.
It definitely can fail, eg. if /dev/console doesn't exist, or if no
console driver is registered.
cheers
next prev parent reply other threads:[~2017-05-17 3:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 21:09 [PATCH] " Rob Landley
2017-05-04 23:34 ` Kees Cook
2017-05-09 21:31 ` Andrew Morton
2017-05-11 17:02 ` Rob Landley
2017-05-11 17:05 ` [PATCHv2] " Rob Landley
2017-05-14 21:35 ` Rob Landley
2017-05-17 3:58 ` Michael Ellerman [this message]
2017-05-17 21:16 ` 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=87ziecnnh1.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=fabf@skynet.be \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=pmladek@suse.com \
--cc=prarit@redhat.com \
--cc=re.emese@gmail.com \
--cc=rob@landley.net \
--cc=yang.shi@linaro.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
all inboxes | Powered by JetHome®