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: <20140715095821.GW9918@twins.programming.kicks-ass.net>
Date:	Tue, 15 Jul 2014 11:58:21 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>
Cc:	Chen LinX <linx.z.chen@...el.com>, paulus@...ba.org,
	mingo@...hat.com, acme@...stprotocols.net,
	linux-kernel@...r.kernel.org, Yanmin Zhang <yanmin.zhang@...el.com>
Subject: Re: [PATCH] perf: Don't enable the perf_event without in
 PERF_ATTACH_CONTEXT status

On Tue, Jul 15, 2014 at 04:56:58PM +0800, Zhang, Yanmin wrote:
> 
> On 2014/7/14 21:27, Peter Zijlstra wrote:
> >On Thu, Jul 03, 2014 at 11:36:38AM +0800, Chen LinX wrote:
> >>From: "Chen LinX" <linx.z.chen@...el.com>
> >>
> >>when do cpu hotplug test and run below perf test together, pmu may access freed perf_event
> >>
> >>while true;
> >>do
> >>perf record -a -g -f sleep 10
> >>rm perf.*
> >>done
> >>
> >>the scenario is that when cpu offline firstly, the 'perf_cpu_notify' will disable event on the
> >>pmu and remove it from the context list. after cpu online, the perf app may enable the event
> >But it does not, right?
> 
> Thanks for your kind comments.
> It does, actually.
> The major reason is application calls many syscall to start perf.
> 1) perf_event_open => perf_install_in_context;
> 2) perf_ioctl => perf_event_enable.

That still does not compute; but you're right, it does call
perf_evlist__enable() which ends up calling IOC_ENABLE when there is no
target (ie. things like perf -a), because we created things with
.enable_on_exec=1.

Similar for ->initial_delay cruft.

> >>Signed-off-by: Yanmin Zhang <yanmin.zhang@...el.com>
> >>Signed-off-by: Chen LinX <linx.z.chen@...el.com>
> >Wrong SoB-chain, Yanmin didn't author this patch did he, seeing how From
> >is you. And Yanmin didn't actually send me this patch either.
> 
> Lin works with me in the same team. He is smart, but new in kernel upstream
> 
> community. I debugged with him and he caught the root cause ahead of me.

Well, then add a Reviewed-by from you or so, the double sob doesn't make
sense.

> The patch is good. 

No its not, its got an incomprehensible changelog, and its not at all
clear why the perf_event_enable() path that doesn't use
__perf_event_enable() is correct.


Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ