Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp491775pxb; Wed, 11 Nov 2020 08:38:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSL+/19y/xRN+zxFh9VZT8U5RuxEtZGMNlksNe4vknYws/gIRjv/eZPCnTp7L/RZeagj68 X-Received: by 2002:a17:906:8387:: with SMTP id p7mr25154745ejx.511.1605112690371; Wed, 11 Nov 2020 08:38:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605112690; cv=none; d=google.com; s=arc-20160816; b=o1s2J7Rzpzv391XJkdIejJivvwvltzFLmHJffMT2orszNGlnz6+ttuwCqoM8xSyAz0 8euDZS2cZf14cLzVZBSczb2wsnL+Dn+79HvyQUSFjZGhbsmxsMmEikMWnwdEbBcH0AQO rXH/YXafIKrQGafznP9Qq7Cz5ndRS2iTPNOoPAE9KVK5JQymGl1X9gn9Ud9YYKZsMu4n yoD4nogpuyekEiXKvNhamjoWUqo3xiJSPDngAKxCHfQ2nhACFh4pi1XUXBINL+2ruRU6 n2JLfc6gPaWaJb2syAPriTVibXc0UnY0ENW2kZsIjWNej5TB3wmZkfrarWXS3QBfwfOB qnGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5coEkhai1837FsTI1eCWh9oM1YcnjV4ypgL1se7Edw8=; b=gGXYMIw+pZpZy6RgSOQGGV4FNgpan2TqicHR5WHz3inoy0OkZG102tcWscuFUjVyR1 zzAjlZJgo1VuBufBWKU9xt1IRoS7Wd9LhlvhRfMKq//idm82+jq9z7POEfpw/3Ln9jub C53aoDu9dZi32P3YF8DhxQCol22f1aaTFNcp0MXKUzmya9ig2OJdp0xO9wPrviaUA7HC JMElj4zS8hmYo3WrISFs2pEEPCMHyTSywqU/pGtvg+bBp91KJH9CYpYH8A9i5C6nU6Tv J16XY5+F3x9qwzLAReAVLXSHHjDmVeqikIEMb874qeTVLWDnfR8Uqyfiytg49lodI7TC 3pNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1ISaLpxz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i59si1846611edd.308.2020.11.11.08.37.45; Wed, 11 Nov 2020 08:38:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1ISaLpxz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbgKKQfg (ORCPT + 99 others); Wed, 11 Nov 2020 11:35:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:54618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725979AbgKKQfg (ORCPT ); Wed, 11 Nov 2020 11:35:36 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 339F9206F1; Wed, 11 Nov 2020 16:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605112533; bh=vF5/Tu4Qygs39cHM41EGa7wsINPDLQw8Vbqv8foqudM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1ISaLpxz5fjyy8Mjol+l4WNuSyZcAD1T9cf8EI7cIbFXSPjlF3WqAiSoTzuz3jq20 vO3Mv0IYXTQD7wIsoQD46GSJD0I8VGO3k8ueHWCbD3WGfAKr2qCDqQCA3fpLJ3voRh C3XZxJmR0FyrNSbgjdYMR7ABeimRYrtkW/GyfZlQ= Date: Wed, 11 Nov 2020 17:36:34 +0100 From: Greg Kroah-Hartman To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , John Ogness , Linus Torvalds , Guenter Roeck , Shreyas Joshi , shreyasjoshi15@gmail.com, Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] init/console: Use ttynull as a fallback when there is no console Message-ID: References: <20201111135450.11214-1-pmladek@suse.com> <20201111135450.11214-2-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201111135450.11214-2-pmladek@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2020 at 02:54:49PM +0100, Petr Mladek wrote: > stdin, stdout, and stderr standard I/O stream are created for the init > process. They are not available when there is no console registered > for /dev/console. It might lead to a crash when the init process > tries to use them, see the commit 48021f98130880dd742 ("printk: handle > blank console arguments passed in."). > > Normally, ttySX and ttyX consoles are used as a fallback when no consoles > are defined via the command line, device tree, or SPCR. But there > will be no console registered when an invalid console name is configured > or when the configured consoles do not exist on the system. > > Users even try to avoid the console intentionally, for example, > by using console="" or console=null. It is used on production > systems where the serial port or terminal are not visible to > users. Pushing messages to these consoles would just unnecessary > slowdown the system. > > Make sure that stdin, stdout, stderr, and /dev/console are always > available by a fallback to the existing ttynull driver. It has > been implemented for exactly this purpose but it was used only > when explicitly configured. > > Signed-off-by: Petr Mladek Tricky, and nice to use the existing driver for this, I like it: Reviewed-by: Greg Kroah-Hartman