From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1B22C41604 for ; Tue, 6 Oct 2020 05:10:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34B2B208C3 for ; Tue, 6 Oct 2020 05:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601961041; bh=/HDOxzvcqV0a4z88WirUH3PPk/2vQQlgIigWfWOmbPc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=1s0oZ51Um2dJ0tlEqzB66EBvwPnAxKiKsuJTIE+Q2W+YRyxJsoqlkTg/9Yo2N0mtm /bW9RZPqDwLyondR0q0AiD11CkjBR4jHNa2REVR5gbxeapb20mzcuA2RYhAp3dUVCc Ztcv7VyD6GxAeRc/z9CXVw+CF0UaZX8QxYC+NhNc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726588AbgJFFKk (ORCPT ); Tue, 6 Oct 2020 01:10:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:47800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgJFFKk (ORCPT ); Tue, 6 Oct 2020 01:10:40 -0400 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 463FC208B6; Tue, 6 Oct 2020 05:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601961039; bh=/HDOxzvcqV0a4z88WirUH3PPk/2vQQlgIigWfWOmbPc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mQK4yJ22SCdJmASayNfvhV/p8wS7/Yoah29/TlwwasREpeboY7bwY3/M0NoLZDD1k 0NGRdQjlOWrCwRlBeGpHoieRpT44mveX+hflcxzUEgLwEIDxdm0m4h7Vnmz9VHUD0t uSFA2jOY2SoMjvwsV6ge2k9gMVVu62vTeOtjYItE= Date: Tue, 6 Oct 2020 07:08:20 +0200 From: Greg Kroah-Hartman To: Guenter Roeck Cc: Sergey Senozhatsky , Petr Mladek , Shreyas Joshi , rostedt@goodmis.org, shreyasjoshi15@gmail.com, linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH] printk: handle blank console arguments passed in. Message-ID: <20201006050820.GA274215@kroah.com> References: <20200522065306.83-1-shreyas.joshi@biamp.com> <20200522100046.GH3464@linux-b0ei> <20201006025935.GA597@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 05, 2020 at 08:35:59PM -0700, Guenter Roeck wrote: > On 10/5/20 7:59 PM, Sergey Senozhatsky wrote: > > Cc-ing Guenter, > > > > On (20/05/22 12:00), Petr Mladek wrote: > >> On Fri 2020-05-22 16:53:06, Shreyas Joshi wrote: > >>> If uboot passes a blank string to console_setup then it results in a trashed memory. > >>> Ultimately, the kernel crashes during freeing up the memory. This fix checks if there > >>> is a blank parameter being passed to console_setup from uboot. > >>> In case it detects that the console parameter is blank then > >>> it doesn't setup the serial device and it gracefully exits. > >>> > >>> Signed-off-by: Shreyas Joshi > >>> --- > >>> V1: > >>> Fixed console_loglevel to default as per the review comments > >>> > >>> kernel/printk/printk.c | 5 ++++- > >>> 1 file changed, 4 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > >>> index ad4606234545..e9ad730991e0 100644 > >>> --- a/kernel/printk/printk.c > >>> +++ b/kernel/printk/printk.c > >>> @@ -2165,7 +2165,10 @@ static int __init console_setup(char *str) > >>> char buf[sizeof(console_cmdline[0].name) + 4]; /* 4 for "ttyS" */ > >>> char *s, *options, *brl_options = NULL; > >>> int idx; > >>> - > >>> + if (str[0] == 0) { > >>> + return 1; > >>> + } > >>> if (_braille_console_setup(&str, &brl_options)) > >>> return 1; > >> > >> I have fixed formatting and pushed it into printk/linux.git, > >> branch for-5.8. > > > > Petr, this patch's causing regressions for us. We use blank console= boot > > param to bypass dts. It appears that it'd be better to revert the change. > > > > Not just to bypass dts, it was also possible to use console= to disable consoles > passed as config option, as well as other default console options. A quick test > confirms that this affects all platforms/architectures, not just Chromebooks. > Prior to this patch, it was possible to disable a default console with an > empty "console=" parameter. This is no longer possible. This means that > this patch results in a substantial (and, as far as I can see, completely > undiscussed) functionality change. > > I don't understand why (yet), but the patch also causes regressions with > seemingly unrelated functionality, specifically with dm-verity on at least > one Chromebook platform. I filed crbug.com/1135157 to track the problem, > and reverted the patch from all our stable releases immediately after > the last round of stable release merges. > > On a side note, I don't see the problem presumably fixed with this > patch in any of my tests. I have no problem reverting this in the stable trees, but are you going to hit this issue in Linus's tree in the next release? thanks, greg k-h