public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] tracing/filters: Support filtering for char * strings
Date: Fri, 07 Aug 2009 11:24:27 +0800	[thread overview]
Message-ID: <4A7B9E6B.2090202@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0908062321420.2840@gandalf.stny.rr.com>

Steven Rostedt wrote:
> On Fri, 7 Aug 2009, Li Zefan wrote:
>>> What protection is this giving us?
>>>
>> __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().
> 
> Ah, so the answer I'm looking for is:
> 
> The filtering will not dereference "char *" unless the developer 
> explicitly sets FILTER_PTR_STR in __field_ext.
> 
> Is this above statement correct?
> 

Exactly. Sorry that I didn't explain it clearly in the
first place. :)


  reply	other threads:[~2009-08-07  3:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06  6:05 [PATCH 0/3] tracing/filters: Support specifying filter hook to a TRACE_EVENT field Li Zefan
2009-08-06  6:06 ` [PATCH 1/3] tracing/filters: Add filter_type to struct ftrace_event_field Li Zefan
2009-08-06  6:06 ` [PATCH 2/3] tracing/filters: Add __field_ext() to TRACE_EVENT Li Zefan
2009-08-06 14:17   ` Steven Rostedt
2009-08-06  6:06 ` [PATCH 3/3] tracing/filters: Support filtering for char * strings Li Zefan
2009-08-06 14:21   ` Steven Rostedt
2009-08-07  1:20     ` Li Zefan
2009-08-07  2:54       ` Steven Rostedt
2009-08-07  3:12         ` Li Zefan
2009-08-07  3:22           ` Steven Rostedt
2009-08-07  3:24             ` Li Zefan [this message]
2009-08-07  3:31               ` Steven Rostedt
2009-08-06 14:23 ` [PATCH 0/3] tracing/filters: Support specifying filter hook to a TRACE_EVENT field Steven Rostedt
2009-08-07  1:08   ` Li Zefan

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=4A7B9E6B.2090202@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /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