From patchwork Wed Sep 15 00:52:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 12495203 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=-11.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 2F2A4C433EF for ; Wed, 15 Sep 2021 00:53:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A03FD61165 for ; Wed, 15 Sep 2021 00:53:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A03FD61165 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1307B900002; Tue, 14 Sep 2021 20:53:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DE9D6B0072; Tue, 14 Sep 2021 20:53:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F3768900002; Tue, 14 Sep 2021 20:53:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id E51E46B006C for ; Tue, 14 Sep 2021 20:53:02 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 036DF3949F for ; Wed, 15 Sep 2021 00:53:01 +0000 (UTC) X-FDA: 78587983404.07.DFA218F Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP id 9665890000A2 for ; Wed, 15 Sep 2021 00:53:01 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 58D726103B; Wed, 15 Sep 2021 00:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631667180; bh=+za6gOGgZTMu0MVI6wOLAb7tqLNqbH1pbLUF+1xhYYY=; h=From:To:Cc:Subject:Date:From; b=ZXxQI1qY9O21rUR13+AL/uJn5GG5mGZmg5xcInMK5TcdeHZZumljOixuitQeWqDUy GCVkJ7ZrWY4zW20g9X14/2c3D/A3/fMYBgl02VN8Ev6x1ISeSQjTvU+MTDSCNVTVzu aF4fK0P0ILpMsGXduS11pROdPdYOnhCcaM7gmV4QWbwZW2xO3DVD0Zp+l59AGUuUGP xt6NRqo7EPqiNOvG4+u9mOcAeVoOXzpUcB+qOsmwvFrOOirSUINWVeRSnlRrGov1Cg TYXexDRibevnp5XbaXkrheo35145t9vtiJVpBSweahy4NrVoxPi4F+AoD32P0pfcaw Mj51CvtWn2iNg== From: Masami Hiramatsu To: Steven Rostedt Cc: Linus Torvalds , Mike Rapoport , Andrew Morton , LKML , Ingo Molnar , Masami Hiramatsu , Linux-MM , Vlastimil Babka Subject: [PATCH v2 0/5] bootconfig: Fixes to bootconfig memory management Date: Wed, 15 Sep 2021 09:52:57 +0900 Message-Id: <163166717752.510331.12843735095061762373.stgit@devnote2> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZXxQI1qY; spf=pass (imf28.hostedemail.com: domain of mhiramat@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=mhiramat@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9665890000A2 X-Stat-Signature: nbp7s3fnbhrra6676a76jnakgb5nypey X-HE-Tag: 1631667181-791821 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: Hello, Here are the series of patches to fix bootconfig memory management issues. From v1, I added some more fixes and split a memory leak fix from freeing unused memory patch. [1/5] fixing kernel BUG issue on boot. Just rebased on the linus tree. [2/5] Add new memblock leak fix in xbc_make_cmdline(). [3/5] Split from [4/5], fixing a memblock leak in setup_boot_config(). [4/5] Free unused memblock after boot. Use new memblock_free_ptr(). [5/5] Fix a tool build error caused by memblock_free_ptr(). And now I'm considering to move ownership of copied bootconfig data to lib/bootconfig. That will make code simpler. But I also think fixing bugs are urgent. So I send this series first. Thank you, --- Masami Hiramatsu (5): bootconfig: Fix to check the xbc_node is used before free it bootconfig: init: Fix memblock leak in xbc_make_cmdline() bootconfig: init: Fix memblock leak in setup_boot_config() bootconfig: Free copied bootconfig data after boot tools/bootconfig: Define memblock_free_ptr() to fix build error init/main.c | 9 +++++++++ lib/bootconfig.c | 3 ++- tools/bootconfig/include/linux/memblock.h | 3 +-- 3 files changed, 12 insertions(+), 3 deletions(-)