[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMGZ=HE=Dmi+j3FHBUMi__cH2DjiSP8JyzPmAPtSotBZ7Rhow@mail.gmail.com>
Date: Thu, 4 Aug 2016 17:17:33 +0200
From: Vegard Nossum <vegard.nossum@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: David Carrillo-Cisneros <davidcc@...gle.com>,
Vineet Gupta <Vineet.Gupta1@...opsys.com>,
Kan Liang <kan.liang@...el.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: Re: NULL ptr deref in perf/filter_match
On 4 August 2016 at 14:37, Peter Zijlstra <peterz@...radead.org> wrote:
> On Fri, Jul 29, 2016 at 11:41:11PM +0200, Vegard Nossum wrote:
>
>> Digging a bit deeper into this, it seems the event itself is getting
>> created by perf_event_open() and it gets added to the pmu_event_list
>> through:
>>
>> perf_event_open()
>> - perf_event_alloc()
>> - account_event()
>> - account_pmu_sb_event()
>> - attach_sb_event()
>>
[...]
>> So I guess the question is... should the event be attached (= put on
>> the list) before ->ctx gets set? Or should the cgroup code check for a
>> NULL ->ctx?
>
> Does this fix it? Ordering is a bit of a mess, adding the events to the
> list _after_ they've been installed has the risk of missing things I
> think, nor does that result in particularly nice code.
>
> Then again, this isn't pretty either.
Patch seems to fix it here, thanks! Feel free to add:
Tested-by: Vegard Nossum <vegard.nossum@...cle.com>
Vegard
Powered by blists - more mailing lists