Message ID | 20231005171747.541123-2-paulmck@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2016:b0:403:3b70:6f57 with SMTP id fe22csp452132vqb; Thu, 5 Oct 2023 10:24:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxuxrTpweRKeTbdDZ9yZbPy7qsV7/0EsIexNeVP5rxTVpl26e51lBWjGgqZASyt4ggJoWD X-Received: by 2002:a05:6a20:54a4:b0:159:b7ba:74bd with SMTP id i36-20020a056a2054a400b00159b7ba74bdmr6383545pzk.50.1696526652187; Thu, 05 Oct 2023 10:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696526652; cv=none; d=google.com; s=arc-20160816; b=W0swFCcUjCQ4JrF5ITXhiosJXYSnD0LcQ0NRpNIsBT+hlFID+v3Semo/pQ8bCSbaZU RHYlTNpUZJwhnuv2g48GxLfgDVGK551BIwmW4x0JRUYfgMFuMSypd9PGTxcUvhXyvp8Y /N7nGjxnMdMUo5EiyCk3GBVbfehw47FrbkN4tB58foRTwZDaCsJdoiQX6N80tJp4+OjV XGUVpuGrtscJwPgAn/jjLCpAYDr69cDv1irJuUqKQdJnxKXekB/N1ZgUt/wyCJk+EC3Q aecWd8bPP8bMfO9xyR+sO+nWL2HPyjtaiS0IArQcfgt32qMeeRZr9gVQLDWxvmQymK0e PIcQ== 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:date:subject:cc:to:from :dkim-signature; bh=+FQS+2S9jhpADvkKOA62oi1uta2UWuhIV2kcg7r8yPw=; fh=L6JXhx3Rs1cDK256tTLM7ULwFG3ewp48JMYDpLQ62cc=; b=E+e/tWT4/P4722EQt7OJgbj3nzqcEzxQODbkTXh6bJA0+2adeXt72nQhNnC/I3hqTQ FnCG5FzSw8AeSmmYh0ty9LhP6PY637SpBUf+E1hWGS6KNmgZOSWG8e8pKFuGoLO45IMf dVxFZ//zbhIWN0ot2qxjxSuyGMZixBzJynU1Sm/LZqJYGEe6S/FC1M+K0A0u5J4oKz4e RjoBiC5zjFkWyiVjM4TNIG9aTWIbK9NzKQu7HCPq3RHoIB3TUDSaws2KRdbZBjWkYqoY 0JwjP54RgrpHSV+akQoujkAr1SlwBrMt6rThRUthG7sfWf1iDiQ3ORFhN3nO/wQ0pTEp Y7xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ljD0DSVX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f20-20020a63f114000000b005644a9be955si1848999pgi.179.2023.10.05.10.24.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 10:24:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ljD0DSVX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 73799802449C; Thu, 5 Oct 2023 10:24:11 -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 S229842AbjJERYG (ORCPT <rfc822;ezelljr.billy@gmail.com> + 18 others); Thu, 5 Oct 2023 13:24:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230401AbjJERXe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 5 Oct 2023 13:23:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7BD33C27; Thu, 5 Oct 2023 10:17:49 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69A67C433C7; Thu, 5 Oct 2023 17:17:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696526269; bh=o5L4igQZuUyyRkvZWeW6hIphjuPRgbdBnW7gTpA7Zqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ljD0DSVXW7mrLs6rk+uo3OA3n8H7FoAXevG0rpTNVXlO2DhM+97akz/db9F7eliN5 SNbIT+B6xWAsEWFkyhHl9KEp9sDqDYd3nOR1FdJrXGba22PQ0OtrtztDB0xiLMUv4U NsIIAYqd5gIEja/x0tSYJgWFIS1sFMR4e5JhWh+kFR6GKb4Z4eU3efb+QA+VxubfD5 iJlmKXTYybduRDmv5K4UakHiSKx5UD2e7jPt8calVUcE8g2+UF9dQYAPuDmVzB9mKK RbgR4Q1HEngsKrSmb1wyPZLhT7YcBmnLC83OK62ejaUH/O5hGMEiPr7lL94GLALGEr 73I98sKn9MlgQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 167D2CE0975; Thu, 5 Oct 2023 10:17:49 -0700 (PDT) From: "Paul E. McKenney" <paulmck@kernel.org> To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org Cc: Jonathan Corbet <corbet@lwn.net>, "Masami Hiramatsu (Google)" <mhiramat@kernel.org>, "Paul E. McKenney" <paulmck@kernel.org>, Linus Torvalds <torvalds@linux-foundation.org>, Stephen Rothwell <sfr@canb.auug.org.au>, Arnd Bergmann <arnd@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Alexey Dobriyan <adobriyan@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, Kees Cook <keescook@chromium.org>, linux-trace-kernel@vger.kernel.org Subject: [PATCH bootconfig 2/3] fs/proc: Add boot loader arguments as comment to /proc/bootconfig Date: Thu, 5 Oct 2023 10:17:46 -0700 Message-Id: <20231005171747.541123-2-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <6ea609a4-12e3-4266-8816-b9fca1f1f21c@paulmck-laptop> References: <6ea609a4-12e3-4266-8816-b9fca1f1f21c@paulmck-laptop> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> 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]); Thu, 05 Oct 2023 10:24:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778937130607936555 X-GMAIL-MSGID: 1778937130607936555 |
Series |
Expose boot-loader kernel command-line arguments
|
|
Commit Message
Paul E. McKenney
Oct. 5, 2023, 5:17 p.m. UTC
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. 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 <mhiramat@kernel.org> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Arnd Bergmann <arnd@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: <linux-trace-kernel@vger.kernel.org> Cc: <linux-fsdevel@vger.kernel.org> --- fs/proc/bootconfig.c | 6 ++++++ 1 file changed, 6 insertions(+)
Comments
On Thu, 5 Oct 2023 10:17:46 -0700 "Paul E. McKenney" <paulmck@kernel.org> 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) <mhiramat@kernel.org> 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 <mhiramat@kernel.org> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> > Signed-off-by: Paul E. McKenney <paulmck@kernel.org> > Cc: Linus Torvalds <torvalds@linux-foundation.org> > Cc: Stephen Rothwell <sfr@canb.auug.org.au> > Cc: Arnd Bergmann <arnd@kernel.org> > Cc: Nick Desaulniers <ndesaulniers@google.com> > Cc: Alexey Dobriyan <adobriyan@gmail.com> > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: Kees Cook <keescook@chromium.org> > Cc: <linux-trace-kernel@vger.kernel.org> > Cc: <linux-fsdevel@vger.kernel.org> > --- > 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 >
On Fri, Oct 06, 2023 at 05:59:48PM +0900, Masami Hiramatsu wrote: > On Thu, 5 Oct 2023 10:17:46 -0700 > "Paul E. McKenney" <paulmck@kernel.org> 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) <mhiramat@kernel.org> > > Thank you! And thank you! I take this as meaning that I should push these three commits for the upcoming v6.7 merge window. Please let me know if I should be doing something else. Thanx, Paul > > 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 <mhiramat@kernel.org> > > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org> > > Cc: Linus Torvalds <torvalds@linux-foundation.org> > > Cc: Stephen Rothwell <sfr@canb.auug.org.au> > > Cc: Arnd Bergmann <arnd@kernel.org> > > Cc: Nick Desaulniers <ndesaulniers@google.com> > > Cc: Alexey Dobriyan <adobriyan@gmail.com> > > Cc: Andrew Morton <akpm@linux-foundation.org> > > Cc: Kees Cook <keescook@chromium.org> > > Cc: <linux-trace-kernel@vger.kernel.org> > > Cc: <linux-fsdevel@vger.kernel.org> > > --- > > 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) <mhiramat@kernel.org>
On Fri, 6 Oct 2023 09:52:30 -0700 "Paul E. McKenney" <paulmck@kernel.org> wrote: > On Fri, Oct 06, 2023 at 05:59:48PM +0900, Masami Hiramatsu wrote: > > On Thu, 5 Oct 2023 10:17:46 -0700 > > "Paul E. McKenney" <paulmck@kernel.org> 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) <mhiramat@kernel.org> > > > > Thank you! > > And thank you! I take this as meaning that I should push these three > commits for the upcoming v6.7 merge window. Please let me know if I > should be doing something else. I have my bootconfig branch, so I think I should pick this and push it to the next window. Does it work? Thank you, > > Thanx, Paul > > > > 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 <mhiramat@kernel.org> > > > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> > > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org> > > > Cc: Linus Torvalds <torvalds@linux-foundation.org> > > > Cc: Stephen Rothwell <sfr@canb.auug.org.au> > > > Cc: Arnd Bergmann <arnd@kernel.org> > > > Cc: Nick Desaulniers <ndesaulniers@google.com> > > > Cc: Alexey Dobriyan <adobriyan@gmail.com> > > > Cc: Andrew Morton <akpm@linux-foundation.org> > > > Cc: Kees Cook <keescook@chromium.org> > > > Cc: <linux-trace-kernel@vger.kernel.org> > > > Cc: <linux-fsdevel@vger.kernel.org> > > > --- > > > 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) <mhiramat@kernel.org>
On Sat, Oct 07, 2023 at 10:42:09AM +0900, Masami Hiramatsu wrote: > On Fri, 6 Oct 2023 09:52:30 -0700 > "Paul E. McKenney" <paulmck@kernel.org> wrote: > > > On Fri, Oct 06, 2023 at 05:59:48PM +0900, Masami Hiramatsu wrote: > > > On Thu, 5 Oct 2023 10:17:46 -0700 > > > "Paul E. McKenney" <paulmck@kernel.org> 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) <mhiramat@kernel.org> > > > > > > Thank you! > > > > And thank you! I take this as meaning that I should push these three > > commits for the upcoming v6.7 merge window. Please let me know if I > > should be doing something else. > > I have my bootconfig branch, so I think I should pick this and push it > to the next window. Does it work? That works for me, and thank you! (And thank you for taking and fixing my whitespace errors in the other two patches!) Thanx, Paul > > > > 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 <mhiramat@kernel.org> > > > > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> > > > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org> > > > > Cc: Linus Torvalds <torvalds@linux-foundation.org> > > > > Cc: Stephen Rothwell <sfr@canb.auug.org.au> > > > > Cc: Arnd Bergmann <arnd@kernel.org> > > > > Cc: Nick Desaulniers <ndesaulniers@google.com> > > > > Cc: Alexey Dobriyan <adobriyan@gmail.com> > > > > Cc: Andrew Morton <akpm@linux-foundation.org> > > > > Cc: Kees Cook <keescook@chromium.org> > > > > Cc: <linux-trace-kernel@vger.kernel.org> > > > > Cc: <linux-fsdevel@vger.kernel.org> > > > > --- > > > > 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) <mhiramat@kernel.org> > > > -- > Masami Hiramatsu (Google) <mhiramat@kernel.org>
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);