[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130123220200.GE6687@ghostprotocols.net>
Date: Wed, 23 Jan 2013 19:02:00 -0300
From: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Colin King <colin.king@...onical.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf evsel: fix NULL pointer deference when
evsel->counts is NULL
Em Mon, Jan 21, 2013 at 01:53:21PM +0900, Namhyung Kim escreveu:
> On Sat, 19 Jan 2013 16:36:54 +0000, Colin King wrote:
> > From: Colin Ian King <colin.king@...onical.com>
> > __perf_evsel__read_on_cpu() only bails out with -ENOMEM if
> > evsel->counts is NULL and perf_evsel__alloc_counts() has returned
> > an error. If perf_evsel__alloc_counts() does not return an error
> > we get an NULL pointer deference on evsel->counts->cpu[cpu]
> > if evsel->counts is NULL.
> perf_evsel__alloc_counts() should allocate evsel->counts when it sees
> evsel->counts is NULL and return negative error code if the allocation
> fails.
> So I don't see any problem in current code. With your code, it won't
> try to allocate if ->counts is NULL but overwrite existing ->counts?
Right, the patch introduces a problem in code that works perfectly :-)
- 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