[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1249888437.17467.42.camel@twins>
Date: Mon, 10 Aug 2009 09:13:57 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Frederic Weisbecker <fweisbec@...il.com>
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 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.
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.
--
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