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=-16.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 9157BC4363D for ; Tue, 6 Oct 2020 11:17:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4933620760 for ; Tue, 6 Oct 2020 11:17:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S9Iv2gxH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726064AbgJFLRI (ORCPT ); Tue, 6 Oct 2020 07:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgJFLRH (ORCPT ); Tue, 6 Oct 2020 07:17:07 -0400 Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A945C061755 for ; Tue, 6 Oct 2020 04:17:06 -0700 (PDT) Received: by mail-oi1-x244.google.com with SMTP id m7so12223921oie.0 for ; Tue, 06 Oct 2020 04:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ed4CPpQf2+RS5LGSULcGr/f7sf1iuf28SM1PWzcx72Y=; b=S9Iv2gxHQxCWFzsKU5ve77A1mu78ohX8tt7S9aE4yMhxrsnpeDAPCCndSXgGymqJfw wX91olia87cpZ+9MzKEfiXklRhOBR2/8NT9XAhRCk8C5ON248m+V/HV7vDXlS/0D0MFp 1uv0Ytj266rZbxoMJlKJUmVugE/CKKZlM80ZFRmj7UArMShJzxvfVLEFIVV4ZWPuwjc2 5OQ8OecrCgjTbCTwJAcxp3znIv0fZL85kuSe7OanlUUskWg3u05DPg+Jp3nEGhP5wQL5 c/P029Y71IfGUJ5raRJBpRsMpGQmFvkS9D7b3NwIWXM/8i0C4/MvrZRQmZ+lAcRLVk8R xYQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ed4CPpQf2+RS5LGSULcGr/f7sf1iuf28SM1PWzcx72Y=; b=ok/Gt4HP64jxa99HloelQbg2bTIaVnw7hA+9JCE4G1Yv8wc/akgYQSCBNgUc1Gkkgq iDRQemZNGVCmwivJnz0yuPA6GCGHq0nv0AGakitkvNIi1at7yWgdknnLmVj28szTWtRp E7HK0q7jnjTidFWFGlTGyiGEqMGcRtc0pYpsV9GvalJPX8R7NmucUzHUaG0obuLv9zg9 tK3asLDaiVHA41dFCa/F82s+/OlEP7yuxLNl0frpUbdb/6AprVYyod42ZruiJPYemRf+ vyxyK1wzBlQ5zAhD6DRudZKN7bGsyHqyZcKR847vHohZCrP1cOEx2mLFQVEHvTy9kt4j ml1Q== X-Gm-Message-State: AOAM532Bf/v9K24n5LmYH/cX2PY0ZUsP6AFojRRSNeZYpdgI0NXPHuKN EX9yj8JrquzyJRLxoLnYJ2g= X-Google-Smtp-Source: ABdhPJzMytdQqi1EXWTkhLvnBAz48cDfurcOKox6wkRveVL6Dbb6b6i5JQCoSGldySeCjIt77bFJFw== X-Received: by 2002:aca:abc7:: with SMTP id u190mr2281532oie.146.1601983025551; Tue, 06 Oct 2020 04:17:05 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id v76sm782096oif.58.2020.10.06.04.17.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Oct 2020 04:17:04 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH] printk: handle blank console arguments passed in. To: Greg Kroah-Hartman Cc: Sergey Senozhatsky , Petr Mladek , Shreyas Joshi , rostedt@goodmis.org, shreyasjoshi15@gmail.com, linux-kernel@vger.kernel.org, Linus Torvalds References: <20200522065306.83-1-shreyas.joshi@biamp.com> <20200522100046.GH3464@linux-b0ei> <20201006025935.GA597@jagdpanzerIV.localdomain> <20201006050820.GA274215@kroah.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUr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m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <055bbf1a-8eb7-7f77-5ea8-31d2ecaf1d4b@roeck-us.net> Date: Tue, 6 Oct 2020 04:17:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201006050820.GA274215@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/5/20 10:08 PM, Greg Kroah-Hartman wrote: > 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? > Not sure what you mean with "next release". As mentioned, I already reverted the patch from all Chrome OS stable branches. We have already seen the problem in the top-of-tree test branch (which is presumably why Sergey brought it up back in May), so we'll definitely have to either revert this patch in the next Chrome OS stable branch (presumably based on 5.10 unless that changes), or we'll have to find find some other (backward-compatible) solution to disable the default console on Chromebooks. Since the patch is already reverted in our branches, it is not an urgent problem for us. But we will need some solution - I really don't want to carry reverts of upstream patches in our trees. Guenter