[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090810073247.GA5508@nowhere>
Date: Mon, 10 Aug 2009 09:32:49 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Mike Galbraith <efault@....de>,
Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH 3/3] perfcounter: Align ftrace events raw samples to 8
bytes
On Mon, Aug 10, 2009 at 09:13:57AM +0200, Peter Zijlstra wrote:
> On Sat, 2009-08-08 at 04:26 +0200, Frederic Weisbecker wrote:
> > Align the ftrace events raw samples to 8 bytes so that they meet the
> > perf output event alignements requirements.
> >
> > Reported-by: Peter Zijlstra <peterz@...radead.org>
> > Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> > Cc: Mike Galbraith <efault@....de>
> > Cc: Paul Mackerras <paulus@...ba.org>
> > ---
> > include/trace/ftrace.h | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
> > index 80e5f6c..7b0834c 100644
> > --- a/include/trace/ftrace.h
> > +++ b/include/trace/ftrace.h
> > @@ -687,7 +687,7 @@ static void ftrace_profile_##call(proto) \
> > pc = preempt_count(); \
> > \
> > __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
> > - __entry_size = __data_size + sizeof(*entry); \
> > + __entry_size = ALIGN(__data_size + sizeof(*entry), sizeof(u64));\
> > \
> > do { \
> > char raw_data[__entry_size]; \
>
> Make sure to clear the trailing few bytes, otherwise we've got a stack
> data leak here.
Oh, right.
> Also, tracepoints using __string() could still easily overflow the stack
> here and cause great havoc, esp since the tracepoint could already be
> deep into a call-chain.
I know yeah, I'll think about a way to store the string parts as pointers
and copy their content on perf_output only.
--
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