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>] [day] [month] [year] [list]
Message-ID: <20200608163625.GC3073@kernel.org>
Date:   Mon, 8 Jun 2020 13:36:25 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Hongbo Yao <yaohongbo@...wei.com>
Cc:     alexander.shishkin@...ux.intel.com, mark.rutland@....com,
        jolsa@...hat.com, namhyung@...nel.org, liwei391@...wei.com,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf util: Fix null pointer dereference

Em Fri, Jun 05, 2020 at 05:17:40PM +0800, Hongbo Yao escreveu:
> If config->aggr_map is Null and config->aggr_get_id is not Null,
> the function print_aggr() will still calling arrg_update_shadow(),
> which can result in accessing the invalid pointer.

Looks legit, but you forgot to add this:

Cc: Jiri Olsa <jolsa@...nel.org>
Fixes: 088519f318be ("perf stat: Move the display functions to stat-display.c")

That is not completely correct as this is just moving pre-existing code
(and bugs) to a different place, but at least the stable guys will get
this fix back to a good number of kernels.

Also you forgot to CC lkml,

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Hongbo Yao <yaohongbo@...wei.com>
> ---
>  tools/perf/util/stat-display.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 3c6976f7574c..57d0706e1330 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -668,7 +668,7 @@ static void print_aggr(struct perf_stat_config *config,
>  	int s;
>  	bool first;
>  
> -	if (!(config->aggr_map || config->aggr_get_id))
> +	if (!config->aggr_map || !config->aggr_get_id)
>  		return;
>  
>  	aggr_update_shadow(config, evlist);
> @@ -1169,7 +1169,7 @@ static void print_percore(struct perf_stat_config *config,
>  	int s;
>  	bool first = true;
>  
> -	if (!(config->aggr_map || config->aggr_get_id))
> +	if (!config->aggr_map || !config->aggr_get_id)
>  		return;
>  
>  	if (config->percore_show_thread)
> -- 
> 2.20.1
> 

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ