[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210312101147.26624a59@gandalf.local.home>
Date: Fri, 12 Mar 2021 10:11:47 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Cao jin <jojing64@...il.com>, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, keescook@...omium.org, vbabka@...e.cz
Subject: Re: [PATCH] bootconfig: Update prototype of setup_boot_config()
On Fri, 12 Mar 2021 10:44:23 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:
> > Why is this using boot_command_line instead of what is passed in, which
> > might be different?
>
> I think you may know the reason...
>
> commit f61872bb58a1cd8f0422aab1940eeee8be579d38
> Author: Steven Rostedt (VMware) <rostedt@...dmis.org>
> Date: Fri Feb 7 19:07:37 2020 -0500
>
> bootconfig: Use parse_args() to find bootconfig and '--'
> ...
> - p = strstr(cmdline, "bootconfig");
> - if (!p || (p != cmdline && !isspace(*(p-1))) ||
> - (p[10] && !isspace(p[10])))
> + strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
> + parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
> + bootconfig_params);
I knew I shouldn't have trusted that code, based on the author :-p
> +
> + if (!bootconfig_found)
>
> I guess since the boot_command_line has fixed length, it is safer to
> allocate fixed length memory for tmp_cmdline. Is that correct?
Yeah, I guess it would be safer. If an arch wants to add bootconfig options
in the setup code, it could then modify how this works in the future. No
need to worry about it now.
Thanks for the review, I'll take this patch then.
-- Steve
Powered by blists - more mailing lists