Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp130965pxk; Mon, 5 Oct 2020 20:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzTcbCJgKhmJLIB9SoJUeq6x/neRsvvtsnDXrB4ZmrePQEdFNRLYOq6fNopWwX2IHMA5pi X-Received: by 2002:a17:906:8545:: with SMTP id h5mr2997819ejy.384.1601955476663; Mon, 05 Oct 2020 20:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601955476; cv=none; d=google.com; s=arc-20160816; b=VjXo5OuiVDnq0PMpWFnLhjx3591zXhlwObv/8Ne7duCXfBNQ9/hqdcTZJq2qW7ugmK Lm6V4uEhySoeWx4U1xxYRzU1RPWG0NVUzIlQ7UVYslvBql4GkThJd5T6n6o4CnUCTem9 lMvVDNgGBVepnsK4ByvkoyEmYLw4rhz+gGYSUISykDQzJJKGZ/oZo/DZZXUsg/O3Vr6v qUEDLdFWFW70WTQZRn0iSwxnLqhY9FNPUK+EM3aKztjwRFnBie1UUCLGIvEySVMLGe43 CRgJ972DYf/IXpNfLN/JTdLtnbkJb+hMaAtNgtIp3Vc/r56Wda+LjZCTsX+syFkOie21 7Awg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:sender:dkim-signature; bh=fKgIvZr0CtFhZw4VtdITEcPYj8HHKx+5kfmcgZQUwP4=; b=0bUSj7G3vOtg/CLXAJUteKMViEJhfUvxavUQYcFJEW3mxcXUVTIHX6VbQ4hWzApah5 NG8joRkphbyXZG8FaiJ6dDVQIW/Gn2uzlmk57m4WBEkslUY4crUTq87ud+vkiCUF23u7 T9BOlOD8W08b6pB96TI6CVuPsztBhNearQ1Eb0wjQ63q83tuHj/tlSYpq1285erBO45i hBFARcOyyvtg9XWpeGA4BIGGpeubWol7+FRaYgQMvqbWG/GaH5DHcobhONfRewGRtSej wXtsydL95TLxOC5dqtSGeHhRVb4ZtMJa6XFz571LdgU6ISbcG4LW+Bv6MvnfgWbmkJrT /lHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SYwgRWMu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si1076378eji.82.2020.10.05.20.37.34; Mon, 05 Oct 2020 20:37:56 -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=@gmail.com header.s=20161025 header.b=SYwgRWMu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726832AbgJFDgF (ORCPT + 99 others); Mon, 5 Oct 2020 23:36:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbgJFDgE (ORCPT ); Mon, 5 Oct 2020 23:36:04 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656B8C0613CE for ; Mon, 5 Oct 2020 20:36:02 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id f37so7402665otf.12 for ; Mon, 05 Oct 2020 20:36:02 -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=fKgIvZr0CtFhZw4VtdITEcPYj8HHKx+5kfmcgZQUwP4=; b=SYwgRWMun0G7+wQOEmhRrg4dhJQ1hTIHS8nAQfaAQXyEsHiSS8OY++HA8Ww0GGW/5z shrZtt5ny5vwha24atuHTQI533x3IwJvcigXV8ntvvsg/69hAM8/DR4cVDcRXGS3kdWG 5HNFQaLHFbCQqasPn/GW3TCVtvdItrB4JpXVzm1XVgDGPzJO8BzJFuwFWNPcryYTr8HT SihLuw6oKIIBQ2gQTmcjoZA0JjLV/RR+CvRV9vjkHrm5q7lWZ2kh0fGz1Jjoe57cKLr/ m5St0zE/9JxX5hmODQOppbE7DYjwJR72/WhtH+YtjaFfu2zzqNn6JaIOeAVuBXlq3bgJ Nycg== 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=fKgIvZr0CtFhZw4VtdITEcPYj8HHKx+5kfmcgZQUwP4=; b=QiS9odYe0t4H02BOJphRsASnzRHDbf0ovsVKZKQGaB8U64G0vYXTfou+F/OASvx5U8 VINv+YpcASEt8sVMjfH3peAreU6RGsKyxU5xwKE6N6KZEDQcfZ5y+yCc23E3NWl+HUo3 c/fP2awc9N/mz6igcDayC4WpWm4Z8tFdngSeHDoTSUhJ8C3YaNeLKmOtN1s+hgreZS+a gN72wib7jTkqmeXIeJb9ELlcrLpuDXolzyCL3O7IJWn4dQRcC1LZjKTi3ioMHy5E48og 63W0+3UBI2cNRp7ux9kdeQgIWX2cCLhvbvrFnCrhZ/OXkI3oWJhxOYsh0ERD2UuMZCWI urrA== X-Gm-Message-State: AOAM531lMm3tb2mIEDvXTh4vLif0d2Xefe6Whmp+M2bxrky2tR/e/PdS LpO3XIr+TJ3xdoBbTE0UP2qnaU5J1oI= X-Received: by 2002:a05:6830:196:: with SMTP id q22mr1575491ota.221.1601955361589; Mon, 05 Oct 2020 20:36:01 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id m15sm555179ooj.10.2020.10.05.20.36.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Oct 2020 20:36:01 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH] printk: handle blank console arguments passed in. To: Sergey Senozhatsky , Petr Mladek Cc: Shreyas Joshi , rostedt@goodmis.org, shreyasjoshi15@gmail.com, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Linus Torvalds References: <20200522065306.83-1-shreyas.joshi@biamp.com> <20200522100046.GH3464@linux-b0ei> <20201006025935.GA597@jagdpanzerIV.localdomain> 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+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl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82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: Date: Mon, 5 Oct 2020 20:35:59 -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: <20201006025935.GA597@jagdpanzerIV.localdomain> 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 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. Guenter