lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f0b03e1-886f-5382-9b86-425b86006569@infradead.org>
Date:   Sun, 9 Jul 2023 06:34:48 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Dong Zhihong <donmor3000@...mail.com>, chenhuacai@...nel.org,
        kernel@...0n.name
Cc:     ardb@...nel.org, tangyouling@...ngson.cn, zhoubinbin@...ngson.cn,
        yangtiezhu@...ngson.cn, tglx@...utronix.de,
        loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] loongarch: Make CONFIG_CMDLINE work with
 CONFIG_CMDLINE_EXTEND and CONFIG_CMDLINE_BOOTLOADER



On 7/9/23 06:32, Dong Zhihong wrote:
> This patch tends to fix broken CONFIG_CMDLINE, which is not working with
> CONFIG_CMDLINE_EXTEND or CONFIG_CMDLINE_BOOTLOADER. Some code is absent in
> arch/loongarch/kernel/setup.c, which should handle built-in command lines
> in CONFIG_CMDLINE. The absence of such code causes CONFIG_CMDLINE not
> working if CONFIG_CMDLINE_EXTEND or CONFIG_CMDLINE_BOOTLOADER is set to Y.
> CONFIG_CMDLINE_FORCE is not affected.
> 
> Signed-off-by: Dong Zhihong <donmor3000@...mail.com>
> ---
>  arch/loongarch/kernel/setup.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c
> index 78a00359bde3..504218b94879 100644
> --- a/arch/loongarch/kernel/setup.c
> +++ b/arch/loongarch/kernel/setup.c
> @@ -335,6 +335,22 @@ static void __init bootcmdline_init(char **cmdline_p)
>  	}
>  #endif
>  
> +#ifdef CONFIG_CMDLINE
> +	/*
> +	 * If CONFIG_CMDLINE_BOOTLOADER is enabled then we use thei built-in

	                                                       the

> +	 * command line if no command line given, or we append given command
> +	 * line to the built-in one if CONFIG_CMDLINE_EXTEND is enabled.
> +	 */
> +	if (IS_ENABLED(CONFIG_CMDLINE_EXTEND)) {
> +		strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
> +		strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
> +		strlcat(boot_command_line, init_command_line, COMMAND_LINE_SIZE);
> +	}
> +
> +	if (IS_ENABLED(CONFIG_CMDLINE_BOOTLOADER) && !boot_command_line[0])
> +		strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
> +#endif
> +
>  out:
>  	*cmdline_p = boot_command_line;
>  }

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ