Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp10700pxu; Mon, 5 Oct 2020 22:14:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEzs0PsBR7GV4XxzHPhkl6pdgEhfw6WIDMh5kkzxiR3mKoflzENCAx/5ew/n/6Q1cnual5 X-Received: by 2002:aa7:d782:: with SMTP id s2mr3378384edq.111.1601961259437; Mon, 05 Oct 2020 22:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601961259; cv=none; d=google.com; s=arc-20160816; b=e+9pqCxCpeQknG9s6pH92lRRUrvDLP2osfIZFPeaEZoLUGVEggfjPNnJuv9tonkmgn bnWnxrQSxuhGWhSW2IS+d4IpKQLSl/2AY0JuIakzT1jUr7oP0UobNbe6EyP1JlkiUDov RJcDbocKnBjVNzHjoZ3+rQRjue0VpWRR7zGyPpav5+GaZNHv1vDYQer4FS7PhJI/igRP cJ0xNUl/P6E9QoVLMXhm3I5j2d0XDr3tIRzR684gL6eMf8RgNppasKmF9+SOvXCh3UOe Oz8UtTQPlAVlDB+9q3XFvEwQLK1xDgCemS1wv3MU+aODfX2XXRUYDufg+nXNm7yDFrZd VX2g== 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=ZlAeW3G3o+CCOV3hhASlKoYJcsQ5m1Sjk48DwcmeyiU=; b=paX68Ujord2poAu/Js7OyESwPZMJEmeeeg1Bc+dc9htK6wlJTZjV9aX9ooTyS6MDku A368ayRob9Iqn78E4CcsQP2f+a4Y8poseuc5MMzv/qYxoVYndKqQ6ctkKWpLjsTfG1P7 AHexmSuQ3ipDYxa2bzEo1dHCup7MTYErdYUFt20+sYapU7xyS4SvTCpKYiD165Inn2k+ GVPW/Xxia9+9pLxx4oWa1QKWJz7YvtY9AZAM84NaV8Y5Nt95oizNnA1E+xQShLo41xeC kAxPrZ6HzdVyoTNVKSCUhJxRz1DEcfwKxVpA8BEidOLT/ESl/ZJb1Dwl8A/DbA3BVx4t Xq0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mQK4yJ22; 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 dr5si1204028ejc.370.2020.10.05.22.13.55; Mon, 05 Oct 2020 22:14:19 -0700 (PDT) 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=mQK4yJ22; 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 S1726007AbgJFFKk (ORCPT + 99 others); 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