Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp243935rdb; Fri, 6 Oct 2023 02:01:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/kbT0/QAj/+3MDEobYG88RKA8Hy9W/uV2kaWubw52qNNnYJoCxS7i1GcjE0Q7Rx5jVL8+ X-Received: by 2002:a17:90b:3892:b0:26b:56fa:87d3 with SMTP id mu18-20020a17090b389200b0026b56fa87d3mr7409771pjb.31.1696582915265; Fri, 06 Oct 2023 02:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696582915; cv=none; d=google.com; s=arc-20160816; b=deYAIvmf+6Kbh9GrDYAS3mRld3CNCa7BYl5z+6et8P78iVhHifWzQskqXccda6cmbK 51AKeIvLmTJBuRhCe5i4Zm0PntY4YN5dbKWwO/TLqlMPu+e0c+9nNeaxeO5p1rOHK2nn H5W9JtrFQ/luWjhaJKyvphIUZpr/oz5wO8Fzc3SOhPdfkUUtRVyU0aDbsNrVzvtOPzGl 4vluujCRQw8oGhBbjKSzTQZpN5/BCNUe0ebv3kWP6o9Yw8gL97jrcr+fjqGb+9GhkKQa 96T3jOXkYJRXaqc56pPSERGottnC718iE70U0RcO/jf+S6YmZjaj0Uv7wk1huAGdmGNs e4Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=myCXnV5i1/BkLJNVlstdsD9QZfL5cgdDPXgHhcF72so=; fh=e62qcV/j89NfXJRBlyCaICJkCzcaC7O+5TFWXSSWkyU=; b=D8S2ADU4Nmz42Zpl2lPdS2M1DI3dHwIxOY79t7RgU1srtPiPamk44k0F6XJBR8yoQB EGXLzJnsVQDB16ormrQHzQtckEMvA6NPff4CGv3os259edyNjWv9J4aQ5eHcyKkdGRUy Xv/WqrWqWAY+UJi6prvOOitOfJPOtd6Szn6owXsNsKjCwIdW+bJ/Z5fx418f8YfgwjAM fypCrPYgb9o7TDlDZedefglHEloLc1fglJZdoO+nK27hwLfKAzbt4ALcx/FgETa+c6mG Jl6CspvfCdH8VYks3LMv2KevxsgEiEzCS3+GYz1rgByhCskG/3XRnVkKzJ9dVm7efzJi jRtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VlgUW7LX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id a14-20020a17090a8c0e00b0027681e3a57fsi5388471pjo.162.2023.10.06.02.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 02:01:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VlgUW7LX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1E8CA8082069; Fri, 6 Oct 2023 02:00:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbjJFI76 (ORCPT + 99 others); Fri, 6 Oct 2023 04:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbjJFI74 (ORCPT ); Fri, 6 Oct 2023 04:59:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEB4793; Fri, 6 Oct 2023 01:59:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E29AFC433C7; Fri, 6 Oct 2023 08:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696582794; bh=ZRZ4zoIUrHvuhR7yir1ccOBONWXMYWEbomq4C32pLnc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VlgUW7LXE3NK3DFuR9GpzTXztcP+gwPt8hH0bcesUwEtCog5ycJc1rulxKq56T0Zn uQNAMZxQsxFbWb/t254r8A7PdDde8ZvBqIni5WbsBICf2nJJLoHNC5Tahog+qcCSXK FaAR1JipdGVB1eJ9GWN1ArOFEb4MTJsr9XMysesZkw0LneLQ3Qv80+J/P131yLxpo1 KKb678z/Hy7PBSBuRk8X9Li4fKQ/Ak0SlrxlAbD4LaJw6cEly6+gtChRpommr9uIGX ASb9M+P8VgKLaEGKznXrgd69lHrfFjKwqjGpSvpBhZPlKIovSGV6Rr54yUk0au5bfH 5Kzo8LwbvZ5xw== Date: Fri, 6 Oct 2023 17:59:48 +0900 From: Masami Hiramatsu (Google) To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, Jonathan Corbet , "Masami Hiramatsu (Google)" , Linus Torvalds , Stephen Rothwell , Arnd Bergmann , Nick Desaulniers , Alexey Dobriyan , Andrew Morton , Kees Cook , linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH bootconfig 2/3] fs/proc: Add boot loader arguments as comment to /proc/bootconfig Message-Id: <20231006175948.14df07948d8c6a4a46473c13@kernel.org> In-Reply-To: <20231005171747.541123-2-paulmck@kernel.org> References: <6ea609a4-12e3-4266-8816-b9fca1f1f21c@paulmck-laptop> <20231005171747.541123-2-paulmck@kernel.org> X-Mailer: Sylpheed 3.7.0 (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-Spam-Status: No, score=-4.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 06 Oct 2023 02:00:15 -0700 (PDT) On Thu, 5 Oct 2023 10:17:46 -0700 "Paul E. McKenney" wrote: > In kernels built with CONFIG_BOOT_CONFIG_FORCE=y, /proc/cmdline will > show all kernel boot parameters, both those supplied by the boot loader > and those embedded in the kernel image. This works well for those who > just want to see all of the kernel boot parameters, but is not helpful to > those who need to see only those parameters supplied by the boot loader. > This is especially important when these parameters are presented to the > boot loader by automation that might gather them from diverse sources. > It is also useful when booting the next kernel via kexec(), in which > case it is necessary to supply only those kernel command-line arguments > from the boot loader, and most definitely not those that were embedded > into the current kernel. > > Therefore, add comments to /proc/bootconfig of the form: > > # Parameters from bootloader: > # root=UUID=ac0f0548-a69d-43ca-a06b-7db01bcbd5ad ro quiet ... > > The second added line shows only those kernel boot parameters supplied > by the boot loader. Thanks for update it. This looks good to me. Acked-by: Masami Hiramatsu (Google) Thank you! > > Link: https://lore.kernel.org/all/CAHk-=wjpVAW3iRq_bfKnVfs0ZtASh_aT67bQBG11b4W6niYVUw@mail.gmail.com/ > Link: https://lore.kernel.org/all/20230731233130.424913-1-paulmck@kernel.org/ > Co-developed-by: Masami Hiramatsu > Signed-off-by: Masami Hiramatsu > Signed-off-by: Paul E. McKenney > Cc: Linus Torvalds > Cc: Stephen Rothwell > Cc: Arnd Bergmann > Cc: Nick Desaulniers > Cc: Alexey Dobriyan > Cc: Andrew Morton > Cc: Kees Cook > Cc: > Cc: > --- > fs/proc/bootconfig.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/fs/proc/bootconfig.c b/fs/proc/bootconfig.c > index 2e244ada1f97..902b326e1e56 100644 > --- a/fs/proc/bootconfig.c > +++ b/fs/proc/bootconfig.c > @@ -62,6 +62,12 @@ static int __init copy_xbc_key_value_list(char *dst, size_t size) > break; > dst += ret; > } > + if (ret >= 0 && boot_command_line[0]) { > + ret = snprintf(dst, rest(dst, end), "# Parameters from bootloader:\n# %s\n", > + boot_command_line); > + if (ret > 0) > + dst += ret; > + } > } > out: > kfree(key); > -- > 2.40.1 > -- Masami Hiramatsu (Google)