Received: by 10.192.165.148 with SMTP id m20csp216009imm; Fri, 4 May 2018 09:09:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrtSwkmo7SmxSqWx204DHSnQKKzl+TWctfLKQekRvvt0v4sCCpawj4al9VB0+KrOS+14o7j X-Received: by 2002:a63:77c9:: with SMTP id s192-v6mr22620013pgc.51.1525450171760; Fri, 04 May 2018 09:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525450171; cv=none; d=google.com; s=arc-20160816; b=Z60k68IrJlI1RxevB3nPUJrjlS4b+8TUt8THK6UvSVxfp2wgFa8y9JQsW5CMwlgpgd RyEPC/jDlqbNoXY7k2hJ2phgenf+LV7bbAkE6oEP5YJ7lAscBA/m4p9zv01dHQ7ozwMZ XIl36lsYwjgzwn8cHtPXuo8GwR8BThYMT1Dd9S2vp790uTdavwFFxFeFd/lfpfWpqWLT w8NyTKKCBM+hphQF5sYWUMjhAeYG3vNy/nsSkZfNBW2fEq31PeQHf4PuDLV9pDGNV5VX Zjut7LjItbgqLN3COQV6eKVqO+knSGfflLKVUm1v1JVq56mI5Can6YhOHVbtmwIL88a7 zpiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=3nrtcL0zQ07KShPuFT9iOlmIsYr+DQqLETauHz5I+vs=; b=fMVfb+SUohR8ZfX3JzWH+/iwCBmHee+9cWK2tiSc5ULMS3xvN71x0Q+brzgxUDGKPo CacLpXTtae/VFAzoTEXJyX4oef/6aTcAFxuEXz0N/Qm8bdGipwXCTm0vI4189qof+p/h DoozK64/vlVdWoTzD1JW7qwnfRExC/MVvbh0PLF74HG/p50ZF0i95YdUDWykOOoSTpdY iKa77w1Zi7aSjAyGlASKJhZZsQJIiBDkaXT/5PhjKRL7tfd+53nkiYOqPlJSVlDSglBT eJyS9eVQ6WDt7wypH84gP12mReqtq1n6HmkYWwKDfg/NaCTeoyM7ZtgG50fPlY+T491G O21A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13-v6si1501066pgu.237.2018.05.04.09.09.17; Fri, 04 May 2018 09:09:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751548AbeEDQIk (ORCPT + 99 others); Fri, 4 May 2018 12:08:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:50571 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751196AbeEDQIj (ORCPT ); Fri, 4 May 2018 12:08:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 62070ABD0; Fri, 4 May 2018 16:08:38 +0000 (UTC) Date: Fri, 4 May 2018 18:08:37 +0200 From: Michal =?UTF-8?B?U3VjaMOhbmVr?= To: Steven Rostedt Cc: Hari Bathini , Ingo Molnar , Andrew Morton , Thomas Gleixner , Kees Cook , Peter Zijlstra , Laura Abbott , Gargi Sharma , Tom Lendacky , Viresh Kumar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] init/main.c: simplify repair_env_string Message-ID: <20180504180837.346cd966@kitsune.suse.cz> In-Reply-To: <20180504114035.111ad8f7@gandalf.local.home> References: <151075904367.14434.5164139208561977016.stgit@hbathini.in.ibm.com> <20171215213317.3151-1-msuchanek@suse.de> <20180504114035.111ad8f7@gandalf.local.home> Organization: SUSE Linux X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 May 2018 11:40:35 -0400 Steven Rostedt wrote: > Cleaning out my INBOX, I stumbled across this old patch. > > On Fri, 15 Dec 2017 22:33:17 +0100 > Michal Suchanek wrote: > > > Quoting characters are now removed from the parameter so value > > always follows directly after the NUL terminating parameter name. > > > > Signed-off-by: Michal Suchanek > > --- > > init/main.c | 13 ++++--------- > > 1 file changed, 4 insertions(+), 9 deletions(-) > > > > Since the previous "[PATCH v9 3/8] lib/cmdline.c: add backslash > > support to kernel commandline parsing" adds the memmove in > > lib/cmdline.c it is now superfluous in init/main.c > > I don't believe the above patches were ever applied. Were they? No, they weren't. The reason to write them was to support the fadump_extra_args argument with peculiar semantics that required the quoting cleanup in kernel argument parsing. A different solution for the fadump memory consumption is in the works so I dropped this. There was lack of interest from reviewers, too. Thanks Michal > > -- Steve > > > > > diff --git a/init/main.c b/init/main.c > > index 1f5fdedbb293..1e5b1dc940d9 100644 > > --- a/init/main.c > > +++ b/init/main.c > > @@ -244,15 +244,10 @@ static int __init repair_env_string(char > > *param, char *val, const char *unused, void *arg) > > { > > if (val) { > > - /* param=val or param="val"? */ > > - if (val == param+strlen(param)+1) > > - val[-1] = '='; > > - else if (val == param+strlen(param)+2) { > > - val[-2] = '='; > > - memmove(val-1, val, strlen(val)+1); > > - val--; > > - } else > > - BUG(); > > + int parm_len = strlen(param); > > + > > + param[parm_len] = '='; > > + BUG_ON(val != param + parm_len + 1); > > } > > return 0; > > } >