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: <875xjcteq2.ffs@tglx>
Date: Thu, 10 Apr 2025 13:53:25 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Borislav Petkov <bp@...en8.de>, Kevin Koster <lkml@...ertech.com>
Cc: Oerg866 <oerg866@...glemail.com>, linux-kernel@...r.kernel.org, Ingo
 Molnar <mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
 x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86/microcode: Consolidate the loader enablement

On Tue, Apr 08 2025 at 19:22, Borislav Petkov wrote:
>  static struct microcode_ops	*microcode_ops;
> -bool dis_ucode_ldr = true;
> +static int dis_ucode_ldr = -1;

This tristate muck is disgusting.
  
>  bool force_minrev = IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV);
>  module_param(force_minrev, bool, S_IRUSR | S_IWUSR);
> @@ -95,11 +95,20 @@ static bool amd_check_current_patch_level(void)
>  	return false;
>  }
>  
> -static bool __init check_loader_disabled_bsp(void)
> +bool __init microcode_loader_disabled(void)
>  {
> -	static const char *__dis_opt_str = "dis_ucode_ldr";
> -	const char *cmdline = boot_command_line;
> -	const char *option  = __dis_opt_str;
> +	if (dis_ucode_ldr < 0) {
> +		if (cmdline_find_option_bool(boot_command_line, "dis_ucode_ldr") <= 0)
> +			dis_ucode_ldr = 0;
> +		else
> +			goto disable;
> +	}

It just exists to make the above a one time operation. What's wrong with
having:

static void __init microcode_check_cmdline(void)
{
	if (cmdline_find_option_bool(boot_command_line, "dis_ucode_ldr") <= 0)
		dis_ucode_ldr = false;
}

and call that once at the proper place?

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ