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: <YwiwCgIoIPnsyanu@zn.tnic>
Date:   Fri, 26 Aug 2022 13:35:38 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Evgeniy Baskov <baskov@...ras.ru>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/5] x86: Add resolve_cmdline() helper

On Wed, May 25, 2022 at 01:10:10PM +0300, Evgeniy Baskov wrote:
> Command line needs to be combined in both compressed and uncompressed
> kernel from built-in and boot command line strings, which requires
> non-trivial logic depending on CONFIG_CMDLINE_BOOL and
> CONFIG_CMDLINE_OVERRIDE.
> 
> Add a helper function to avoid code duplication.
> 
> Signed-off-by: Evgeniy Baskov <baskov@...ras.ru>
> 

You have some weird configuration to your git send-email which doesn't
add the "---" to split the patch commit message from the diffstat.

>  create mode 100644 arch/x86/include/asm/shared/setup-cmdline.h
> 
> diff --git a/arch/x86/include/asm/shared/setup-cmdline.h b/arch/x86/include/asm/shared/setup-cmdline.h

Just cmdline.h I'd say.

> new file mode 100644
> index 000000000000..9822e5af4925
> --- /dev/null
> +++ b/arch/x86/include/asm/shared/setup-cmdline.h
> @@ -0,0 +1,38 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef _ASM_X86_SETUP_CMDLINE_H
> +#define _ASM_X86_SETUP_CMDLINE_H
> +
> +#define _SETUP
> +#include <asm/setup.h> /* For COMMAND_LINE_SIZE */
> +#undef _SETUP
> +
> +#include <linux/string.h>
> +
> +#ifdef CONFIG_CMDLINE_BOOL
> +#define COMMAND_LINE_INIT CONFIG_CMDLINE
> +#else
> +#define COMMAND_LINE_INIT ""
> +#endif
> +
> +/*
> + * command_line and boot_command_line are expected to be at most
> + * COMMAND_LINE_SIZE length. command_line needs to be initialized
> + * with COMMAND_LINE_INIT.
> + */
> +


^ Superfluous newline.

> +static inline void resolve_cmdline(char *command_line,
> +				   const char *boot_command_line)

cmdline_prepare() I'd say.

> +{
> +#ifdef CONFIG_CMDLINE_BOOL
> +	if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) {
> +		/* Append boot loader cmdline to builtin */
> +		strlcat(command_line, " ", COMMAND_LINE_SIZE);
> +		strlcat(command_line, boot_command_line, COMMAND_LINE_SIZE);
> +	}
> +#else
> +	strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);

So that has been switched to strscpy() in the meantime:

8a33d96bd178 ("x86/setup: Use strscpy() to replace deprecated strlcpy()")

Please redo your set ontop of latest tip/master.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ