From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752949AbdEQD6m (ORCPT ); Tue, 16 May 2017 23:58:42 -0400 Received: from ozlabs.org ([103.22.144.67]:57703 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbdEQD6j (ORCPT ); Tue, 16 May 2017 23:58:39 -0400 From: Michael Ellerman To: Rob Landley , Andrew Morton Cc: "linux-kernel\@vger.kernel.org" , Prarit Bhargava , "Eric W. Biederman" , Yang Shi , Rasmus Villemoes , Kees Cook , Emese Revfy , Petr Mladek , Fabian Frederick Subject: Re: [PATCHv2] Make initramfs honor CONFIG_DEVTMPFS_MOUNT In-Reply-To: <21935caf-501d-e97c-5611-5c4af7e0f9ae@landley.net> References: <20170509143132.661c9299d8d5094a09a6059d@linux-foundation.org> <21935caf-501d-e97c-5611-5c4af7e0f9ae@landley.net> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Wed, 17 May 2017 13:58:34 +1000 Message-ID: <87ziecnnh1.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rob Landley 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