public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing/filters: disallow integer values for string filters and vice versa
@ 2009-03-24  7:14 Tom Zanussi
  2009-03-24  7:28 ` [tip:tracing/filters] " Tom Zanussi
  2009-03-26  9:18 ` [tip:tracing/filters] tracing: filter fix for TRACE_EVENT_FORMAT events Tom Zanussi
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Zanussi @ 2009-03-24  7:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Steven Rostedt, Frédéric Weisbecker

Make sure filters for string fields don't use integer values and vice
versa.  Getting it wrong can crash the system or produce bogus
results.  

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>

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

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 9fca8bb..026be41 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -237,9 +237,14 @@ int filter_add_pred(struct ftrace_event_call *call, struct filter_pred *pred)
 	pred->offset = field->offset;
 
 	if (is_string_field(field->type)) {
+		if (!pred->str_val)
+			return -EINVAL;
 		pred->fn = filter_pred_string;
 		pred->str_len = field->size;
 		return __filter_add_pred(call, pred);
+	} else {
+		if (pred->str_val)
+			return -EINVAL;
 	}
 
 	switch (field->size) {
-- 
1.5.6.3




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-26  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24  7:14 [PATCH] tracing/filters: disallow integer values for string filters and vice versa Tom Zanussi
2009-03-24  7:28 ` [tip:tracing/filters] " Tom Zanussi
2009-03-26  9:18 ` [tip:tracing/filters] tracing: filter fix for TRACE_EVENT_FORMAT events Tom Zanussi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox