mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Shaohua Li <shaohua.li@intel.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	srostedt@redhat.com, "Huang, Ying" <ying.huang@intel.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [RFC]ftrace: fix a unallocated memory access in function_graph
Date: Fri, 06 Aug 2010 12:09:30 -0400	[thread overview]
Message-ID: <1281110970.3352.1.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1280217994.32400.76.camel@sli10-desk.sh.intel.com>

Sorry for the late response, I just got back from vacation.

Also note, please do not send to my RH account. I do not check it as
much. Send emails to me to this (goodmis) account.


On Tue, 2010-07-27 at 16:06 +0800, Shaohua Li wrote:
> With CONFIG_DEBUG_PAGEALLOC, I observed a unallocated memory access in
> function_graph trace. It appears we find a small size entry in ring buffer, but
> we access it as a big size entry. The access overflows a page size and touch
> a unallocated page.

Nice catch! This is a legit bug. I'll prepare it for 2.6.36, as well as
send it off to stable.

Thanks!

-- Steve

> 
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> 
> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> index 79f4bac..33b379d 100644
> --- a/kernel/trace/trace_functions_graph.c
> +++ b/kernel/trace/trace_functions_graph.c
> @@ -507,7 +507,10 @@ get_return_for_leaf(struct trace_iterator *iter,
>  			 * if the output fails.
>  			 */
>  			data->ent = *curr;
> -			data->ret = *next;
> +			if (next->ent.type == TRACE_GRAPH_RET)
> +				data->ret = *next;
> +			else
> +				data->ret.ent.type = next->ent.type;
>  		}
>  	}
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



  reply	other threads:[~2010-08-06 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27  8:06 Shaohua Li
2010-08-06 16:09 ` Steven Rostedt [this message]
2010-08-16 17:30 ` [tip:perf/urgent] tracing: Fix an " tip-bot for Shaohua Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281110970.3352.1.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=shaohua.li@intel.com \
    --cc=srostedt@redhat.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®