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] [day] [month] [year] [list]
Date:   Tue, 28 Dec 2021 22:07:07 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Yang Li <yang.lee@...ux.alibaba.com>
Cc:     tglx@...utronix.de, mingo@...hat.com, dave.hansen@...ux.intel.com,
        x86@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
        Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr

On Fri, Dec 10, 2021 at 11:22:07AM +0800, Yang Li wrote:
> From: Li Yang <yang.lee@...ux.alibaba.com>
> 
> In the current scenario, variable 'hi' set but not used,
> rdmsrl() does not change the function, but it is more concise.
> 
> Eliminate the following clang warnings:
> arch/x86/kernel/process.c:889:10: warning: variable 'hi' set but not
> used [-Wunused-but-set-variable]
> 
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Li Yang <yang.lee@...ux.alibaba.com>
> ---
>  arch/x86/kernel/process.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 5d481038fe0b..b415f30278d1 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -886,7 +886,7 @@ void amd_e400_c1e_apic_setup(void)
>  
>  void __init arch_post_acpi_subsys_init(void)
>  {
> -	u32 lo, hi;
> +	u32 lo;
>  
>  	if (!boot_cpu_has_bug(X86_BUG_AMD_E400))
>  		return;
> @@ -896,7 +896,7 @@ void __init arch_post_acpi_subsys_init(void)
>  	 * the machine is affected K8_INTP_C1E_ACTIVE_MASK bits are set in
>  	 * MSR_K8_INT_PENDING_MSG.
>  	 */
> -	rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
> +	rdmsrl(MSR_K8_INT_PENDING_MSG, lo);
>  	if (!(lo & K8_INTP_C1E_ACTIVE_MASK))
>  		return;
>  
> -- 

I believe you folks have been warned a bunch of times to think first
before acting upon a warning your silly bot catches.

Because your "fix" shows that you didn't even look at rdmsrl()'s
definition and what the second variable width is.

gcc explains it this way:

arch/x86/kernel/process.c: In function ‘arch_post_acpi_subsys_init’:
./arch/x86/include/asm/msr.h:277:11: warning: conversion from ‘long long unsigned int’ to ‘u32’ {aka ‘unsigned int’} may change value [-Wconversion]
  277 |  ((val) = native_read_msr((msr)))
      |           ^~~~~~~~~~~~~~~
arch/x86/kernel/process.c:899:2: note: in expansion of macro ‘rdmsrl’
  899 |  rdmsrl(MSR_K8_INT_PENDING_MSG, lo);
      |  ^~~~~~

so I'm ignoring all submissions from you from now on.

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