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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200518152351.GD24211@kernel.org>
Date:   Mon, 18 May 2020 12:23:51 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Jiri Olsa <jolsa@...nel.org>
Cc:     Joakim Zhang <qiangqing.zhang@....com>,
        Andi Kleen <ak@...ux.intel.com>,
        lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Michael Petlan <mpetlan@...hat.com>
Subject: Re: [PATCH] perf stat: Fix duration_time value for higher intervals

Em Mon, May 18, 2020 at 03:14:45PM +0200, Jiri Olsa escreveu:
> Joakim reported wrong duration_time value for interval bigger
> than 4000 [1].
> 
> The problem is in the interval value we pass to update_stats
> function, which is typed as 'unsigned int' and overflows when
> we get over 2^32 (happens between intervals 4000 and 5000).
> 
> Retyping the passed value to unsigned long long.

Thanks, applied and added this:

Fixes: b90f1333ef08 ("perf stat: Update walltime_nsecs_stats in interval mode")

Ok?

- Arnaldo

> [1] https://www.spinics.net/lists/linux-perf-users/msg11777.html
> 
> Reported-by: Joakim Zhang <qiangqing.zhang@....com>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
>  tools/perf/builtin-stat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index e0c1ad23c768..4deb2d46a343 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -367,7 +367,7 @@ static void process_interval(void)
>  	}
>  
>  	init_stats(&walltime_nsecs_stats);
> -	update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000);
> +	update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000ULL);
>  	print_counters(&rs, 0, NULL);
>  }
>  
> -- 
> 2.25.4
> 

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ