All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Li Zefan <lizf@cn.fujitsu.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	fweisbec@gmail.com, rostedt@goodmis.org, lizf@cn.fujitsu.com,
	tglx@linutronix.de
Subject: [tip:tracing/urgent] tracing/filters: strloc should be unsigned short
Date: Mon, 15 Jun 2009 18:13:50 GMT	[thread overview]
Message-ID: <tip-0ac2058f686a19fe8ab25c4f3104fc1580dce7cf@git.kernel.org> (raw)
In-Reply-To: <4A35B905.3090500@cn.fujitsu.com>

Commit-ID:  0ac2058f686a19fe8ab25c4f3104fc1580dce7cf
Gitweb:     http://git.kernel.org/tip/0ac2058f686a19fe8ab25c4f3104fc1580dce7cf
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Mon, 15 Jun 2009 10:59:17 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Mon, 15 Jun 2009 11:37:18 -0400

tracing/filters: strloc should be unsigned short

I forgot to update filter code accordingly in
"tracing/events: change the type of __str_loc_item to unsigned short"
(commt b0aae68cc5508f3c2fbf728988c954db4c8b8a53)

It can cause system crash:

 # echo 1 > tracing/events/irq/irq_handler_entry/enable
 # echo 'name == eth0' > tracing/events/irq/irq_handler_entry/filter

[ Impact: fix crash while filtering on __string() field ]

Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A35B905.3090500@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


---
 kernel/trace/trace_events_filter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 1d81923..b24ab0e 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -178,7 +178,7 @@ static int filter_pred_string(struct filter_pred *pred, void *event,
 static int filter_pred_strloc(struct filter_pred *pred, void *event,
 			      int val1, int val2)
 {
-	int str_loc = *(int *)(event + pred->offset);
+	unsigned short str_loc = *(unsigned short *)(event + pred->offset);
 	char *addr = (char *)(event + str_loc);
 	int cmp, match;
 

  reply	other threads:[~2009-06-15 18:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15  2:56 [PATCH 0/4] tracing: some fixes for 2.6.31 Li Zefan
2009-06-15  2:56 ` [PATCH 1/4] tracing: fix a typo in tracing_cpumask_write() Li Zefan
2009-06-15 18:13   ` [tip:tracing/urgent] " tip-bot for Li Zefan
2009-06-15  2:57 ` [PATCH 2/4] tracing: replace a GFP_ATOMIC with GFP_KERNEL allocation Li Zefan
2009-06-15 18:13   ` [tip:tracing/urgent] " tip-bot for Li Zefan
2009-06-15  2:58 ` [PATCH 3/4] tracing/filters: operand can be negative Li Zefan
2009-06-15 18:13   ` [tip:tracing/urgent] " tip-bot for Li Zefan
2009-06-15  2:59 ` [PATCH 4/4] tracing/filters: strloc should be unsigned short Li Zefan
2009-06-15 18:13   ` tip-bot for Li Zefan [this message]
2009-06-15 12:21 ` [PATCH 0/4] tracing: some fixes for 2.6.31 Frederic Weisbecker
2009-06-15 12:48   ` Steven Rostedt

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=tip-0ac2058f686a19fe8ab25c4f3104fc1580dce7cf@git.kernel.org \
    --to=lizf@cn.fujitsu.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.