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:   Wed, 15 Sep 2021 09:12:34 +0200
From:   Giovanni Gherdovich <ggherdovich@...e.cz>
To:     Tim Gardner <tim.gardner@...onical.com>, x86@...nel.org
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Alison Schofield <alison.schofield@...el.com>,
        Nathan Fontenot <nathan.fontenot@....com>,
        Balbir Singh <sblbir@...zon.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/smp: Unused value freq_scale

On Fri, 2021-09-10 at 12:44 -0600, Tim Gardner wrote:
> Coverity warns of an unused value in arch_scale_freq_tick().
> 
> CID 100778 (#1 of 1): Unused value (UNUSED_VALUE)
> assigned_value: Assigning value 1024ULL to freq_scale here, but that stored
> value is overwritten before it can be used.
> 
> e2b0d619b400a ("x86, sched: check for counters overflow in frequency invariant
> accounting") introduced this warning.
> 
> Fix this by removing the variable initializer.
> 
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: x86@...nel.org
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: "Peter Zijlstra (Intel)" <peterz@...radead.org>
> Cc: Giovanni Gherdovich <ggherdovich@...e.cz>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
> Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
> Cc: Alison Schofield <alison.schofield@...el.com>
> Cc: Nathan Fontenot <nathan.fontenot@....com>
> Cc: Balbir Singh <sblbir@...zon.com>
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Tim Gardner <tim.gardner@...onical.com>
> ---
>  arch/x86/kernel/smpboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 85f6e242b6b4..c453b825a57f 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -2166,7 +2166,7 @@ DEFINE_PER_CPU(unsigned long, arch_freq_scale) = SCHED_CAPACITY_SCALE;
>  
>  void arch_scale_freq_tick(void)
>  {
> -	u64 freq_scale = SCHED_CAPACITY_SCALE;
> +	u64 freq_scale;
>  	u64 aperf, mperf;
>  	u64 acnt, mcnt;
>  

Reviewed-by: Giovanni Gherdovich <ggherdovich@...e.cz>


Thanks,
Giovanni

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ