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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 454DFC433F5 for ; Thu, 7 Oct 2021 01:02:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8FD6761152 for ; Thu, 7 Oct 2021 01:02:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8FD6761152 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D6C9D900002; Wed, 6 Oct 2021 21:02:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1CD26B0071; Wed, 6 Oct 2021 21:02:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE2C5900002; Wed, 6 Oct 2021 21:02:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id AF0CF6B006C for ; Wed, 6 Oct 2021 21:02:20 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4F59A18017BFB for ; Thu, 7 Oct 2021 01:02:20 +0000 (UTC) X-FDA: 78667840440.23.73F5996 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf19.hostedemail.com (Postfix) with ESMTP id 073D0B001555 for ; Thu, 7 Oct 2021 01:02:19 +0000 (UTC) Received: from rorschach.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 62A8060F6B; Thu, 7 Oct 2021 01:02:18 +0000 (UTC) Date: Wed, 6 Oct 2021 21:02:16 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: Linus Torvalds , Mike Rapoport , Andrew Morton , LKML , Ingo Molnar , Linux-MM , Vlastimil Babka Subject: Re: [PATCH v4 1/4] bootconfig: init: Fix memblock leak in xbc_make_cmdline() Message-ID: <20211006210216.2fdf63cd@rorschach.local.home> In-Reply-To: <163177339181.682366.8713781325929549256.stgit@devnote2> References: <163177338366.682366.5998343833719057348.stgit@devnote2> <163177339181.682366.8713781325929549256.stgit@devnote2> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 073D0B001555 X-Stat-Signature: 78k3dde53684eygcusyc4sxxg411zs58 Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf19.hostedemail.com: domain of "SRS0=oVYk=O3=goodmis.org=rostedt@kernel.org" designates 198.145.29.99 as permitted sender) smtp.mailfrom="SRS0=oVYk=O3=goodmis.org=rostedt@kernel.org" X-HE-Tag: 1633568539-558091 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 16 Sep 2021 15:23:12 +0900 Masami Hiramatsu wrote: > Free unused memblock in a error case to fix memblock leak > in xbc_make_cmdline(). > > Fixes: 51887d03aca1 ("bootconfig: init: Allow admin to use bootconfig for kernel command line") > Signed-off-by: Masami Hiramatsu > --- > init/main.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/init/main.c b/init/main.c > index 3f7216934441..0b054fff8e92 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -382,6 +382,7 @@ static char * __init xbc_make_cmdline(const char *key) > ret = xbc_snprint_cmdline(new_cmdline, len + 1, root); > if (ret < 0 || ret > len) { > pr_err("Failed to print extra kernel cmdline.\n"); > + memblock_free_ptr(new_cmdline, len + 1); > return NULL; > } > Hmm, looking at my patch queue, I noticed that this did not get applied. I'm thinking I may have been confused with the other memory freeing that was put into the xbc_destroy(), thinking this was part of that. But now that I look at this patch in the context of the code, it looks like this patch is required, as "new_cmdline" never gets exposed on this error. Masami, I just want to confirm, that this patch is still relevant, right? Thanks! -- Steve