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]
Date:   Fri, 17 Apr 2020 17:08:08 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Mihai Carabas <mihai.carabas@...cle.com>
Cc:     linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86: microcode: fix return value for microcode late
 loading

On Tue, Apr 14, 2020 at 12:55:35PM +0300, Mihai Carabas wrote:
> The return value from stop_machine might not be consistent.
> 
> stop_machine_cpuslocked returns:
> - zero if all functions have returned 0
> - a non-zero value if at least one of the functions returned
> a non-zero value
> 
> There is no way to know if it is negative or positive. So make
> __reload_late return 0 on success, or negative otherwise.
> 
> Signed-off-by: Mihai Carabas <mihai.carabas@...cle.com>
> ---
>  arch/x86/kernel/cpu/microcode/core.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
> index 7019d4b..336003e 100644
> --- a/arch/x86/kernel/cpu/microcode/core.c
> +++ b/arch/x86/kernel/cpu/microcode/core.c
> @@ -545,8 +545,7 @@ static int __wait_for_cpus(atomic_t *t, long long timeout)
>  /*
>   * Returns:
>   * < 0 - on error
> - *   0 - no update done
> - *   1 - microcode was updated
> + *   0 - success (no update done or microcode was updated)
>   */
>  static int __reload_late(void *info)
>  {
> @@ -573,11 +572,9 @@ static int __reload_late(void *info)
>  	else
>  		goto wait_for_siblings;
>  
> -	if (err > UCODE_NFOUND) {
> +	if (err >= UCODE_NFOUND) {

It is not an error if no microcode was found.

>  		pr_warn("Error reloading microcode on CPU %d\n", cpu);
			^^^^^^^^^^

>  		ret = -1;

-- 
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