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]
Message-ID: <20190312143411.GD4939@kernel.org>
Date:   Tue, 12 Mar 2019 11:34:11 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Song Liu <songliubraving@...com>, bpf@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        ast@...nel.org, daniel@...earbox.net, kernel-team@...com,
        peterz@...radead.org, acme@...hat.com, jolsa@...nel.org,
        namhyung@...nel.org, sdf@...ichev.me,
        Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH v9 perf,bpf 06/15] perf, bpf: save bpf_prog_info in a
 rbtree in perf_env

Em Tue, Mar 12, 2019 at 02:10:33PM +0100, Jiri Olsa escreveu:
> On Mon, Mar 11, 2019 at 10:30:42PM -0700, Song Liu wrote:
> 
> SNIP
> 
> > +/* purge data in bpf_progs.infos tree */
> > +static void perf_env__purge_bpf(struct perf_env *env)
> > +{
> > +	struct rb_root *root;
> > +	struct rb_node *next;
> > +
> > +	down_write(&env->bpf_progs.lock);
> > +
> > +	root = &env->bpf_progs.infos;
> > +	next = rb_first(root);
> > +
> > +	while (next) {
> > +		struct bpf_prog_info_node *node;
> > +
> > +		node = rb_entry(next, struct bpf_prog_info_node, rb_node);
> > +		next = rb_next(&node->rb_node);
> > +		rb_erase(&node->rb_node, root);
> > +		free(node);
> > +	}
> 
> 	env->bpf_progs.infos_cnt = 0;  ?
> 
> but it's probably not needed given the current usage

Better be safe than sorry, see the Andi's "perf, tools, stat: Avoid
memory overrun with -r" :-)

I'll add the infos_cnt = 0 here.
 
> jirka
> 
> > +	up_write(&env->bpf_progs.lock);
> > +}
> 
> SNIP

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ