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] [day] [month] [year] [list]
Message-ID: <20140929183357.GI3879@kernel.org>
Date:	Mon, 29 Sep 2014 15:33:57 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Alexander Yarygin <yarygin@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org,
	Christian Borntraeger <borntraeger@...ibm.com>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>, Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung.kim@....com>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 1/2] perf session: Add option to copy events when queueing

Em Mon, Sep 22, 2014 at 09:04:10AM +0200, Jiri Olsa escreveu:
> On Thu, Sep 18, 2014 at 09:07:38PM +0400, Alexander Yarygin wrote:
> > +++ b/tools/perf/util/session.c
> > @@ -542,7 +542,13 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
> >  		return -ENOMEM;

> >  	new->file_offset = file_offset;
> > -	new->event = event;

> > +	if (s->copy_on_queue) {
> > +		new->event = malloc(event->header.size);
> > +		memcpy(new->event, event, event->header.size);

> we have memdup, and you need to check for allocation failure

Right.
 
> hum.. how about allocation limits?
 
> Now have report.queue-size to keep track and limit the ordered_events
> memory size. I think we should add this allocation size under this
> limit as well.

Yup.
 
> > +	} else
> > +		new->event = event;
> > +
> 
> also the copy_on_queue flag and the logic above feels more like
> it belongs to 'ordered_events' object to me

Agreed.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ