Received: by 10.192.165.148 with SMTP id m20csp187782imm; Fri, 4 May 2018 08:42:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp6Tbk/Y5nL4La2LKmZEjIgkD1XS+f5RlLvC2uf6aoLvOS95w8zwbOaS8sThLAnTulVnVwh X-Received: by 2002:a17:902:5948:: with SMTP id e8-v6mr28930939plj.121.1525448547303; Fri, 04 May 2018 08:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525448547; cv=none; d=google.com; s=arc-20160816; b=RXf+6irqtICCFTdRHkhraOeXxZ9qiUsg4f2/ObFJ8U7SZSg5W4SMxMTp7+py4SpLI0 12htopA6NorRQ1M93ineixhEfk9AZswOgikj6I11lGANo68wZxHZVuprNaa9j7y6Ar/h E5V6PwOnDvO7ogUEuFQ/Fk+yHLmNO3x2iGJ8MKdnxwYSc+AGCFvtAtg3y0SD38S0TVx8 rjUlwQX9/NwuwVizSueS/WlNRtgErx6Zhy5Sf01iIGw1KfXmJVxe5AXfsPh4HvInF6Zd sdaqkqeOWPA888soaRVOgQBsfGjZucsXZ3VXyE9GB+MBrkmjOragnu1brPVoQD0HM2Bz FKeg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=f5LnIgLzVg8Veu1nAKhJ7mOEah9nr6VU4dTH3J1U7nY=; b=C94ZjSRuHtwMBE01/1XRcWXLkyaEoAr0ZpOY7dENr9kruaJCCKBenW/kxCO709L1zE zCOJqOSqkiVxWjHPwklT8qILMMu1GVhSlk0b3wjg5t9BXB6y/JkZc/WHVxpZhTZleVOw agOC4Phhs9QWCuxSOE11MdzQAoSZTrXm/OBX3WJe1lDZvaRfcO4r+SqFqRPSmoxOkqLe 6vsPOY1Z1WuDPRJfnCAEfCbWxAPhxOfJ3GXmOIRKlItfaLiqs97aOGnBBPmk6QGSgFZt d4ft+ap8pSE8LVz2vX9/rJXFfH6IyoNw1VMBgCS5xKgYiKEIBadDVYjiaSbPIBq2wyXX mC+w== 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 o2-v6si3083403plk.527.2018.05.04.08.42.12; Fri, 04 May 2018 08:42:27 -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 S1751527AbeEDPkj (ORCPT + 99 others); Fri, 4 May 2018 11:40:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:55302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262AbeEDPki (ORCPT ); Fri, 4 May 2018 11:40:38 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 2E0D72176D; Fri, 4 May 2018 15:40:37 +0000 (UTC) Date: Fri, 4 May 2018 11:40:35 -0400 From: Steven Rostedt To: Michal Suchanek 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: <20180504114035.111ad8f7@gandalf.local.home> In-Reply-To: <20171215213317.3151-1-msuchanek@suse.de> References: <151075904367.14434.5164139208561977016.stgit@hbathini.in.ibm.com> <20171215213317.3151-1-msuchanek@suse.de> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-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 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? -- 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; > }