Re: [PATCH 3/3] tracing/filters: Support filtering for char * strings

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Li Zefan
Date: Thursday, August 6, 2009 - 8:12 pm

Steven Rostedt wrote:

__field(char *) suggests it should be treated as plain pointer,
while __field_ext(char *, FILTER_PTR_STR) suggests he's aware it's
safe to dereference the pointer, for example the case in Frederic's
blk events.

In Frederic's initial version, "char *" field will always be
attached to ptr_str filter function. This is unsafe, because for
other fields defined as "char *" but not safe to dereference,
a user still can do this:

	# echo 'name == abc' > filter

Then we'll deref a pointer that can point to unsafe data.

In this patch, this won't happen, as long as the developer is
aware that his use of __field_ext(char *) is right.

Otherwise, he will just use normal __field(char *) and print
the pointer itself in TP_printk().

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 3/3] tracing/filters: Support filtering for cha ..., Li Zefan, (Thu Aug 6, 8:12 pm)