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:   Tue, 15 Oct 2019 12:02:11 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf annotate: Fix multiple memory and file descriptor
 leaks

Em Tue, Oct 15, 2019 at 10:46:32AM +0200, Jiri Olsa escreveu:
> On Mon, Oct 14, 2019 at 12:10:47PM -0500, Gustavo A. R. Silva wrote:
> > Store SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF in variable *ret*, instead
> > of returning in the middle of the function and leaking multiple
> > resources: prog_linfo, btf, s and bfdf.
> > 
> > Addresses-Coverity-ID: 1454832 ("Structurally dead code")
> > Fixes: 11aad897f6d1 ("perf annotate: Don't return -1 for error when doing BPF disassembly")
> > Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> 
> Acked-by: Jiri Olsa <jolsa@...nel.org>
> 
> thanks,
> jirka
> 
> > ---
> >  tools/perf/util/annotate.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> > index 4036c7f7b0fb..e42bf572358c 100644
> > --- a/tools/perf/util/annotate.c
> > +++ b/tools/perf/util/annotate.c
> > @@ -1758,7 +1758,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> >  	info_node = perf_env__find_bpf_prog_info(dso->bpf_prog.env,
> >  						 dso->bpf_prog.id);
> >  	if (!info_node) {
> > -		return SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF;
> > +		ret = SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF;
> >  		goto out;

Ouch, unreachable goto, /me ducks

- Arnaldo

> >  	}
> >  	info_linear = info_node->info_linear;
> > -- 
> > 2.23.0
> > 

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ