lkml.org 
[lkml]   [2009]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] tracing/filters: Support filtering for char * strings
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. :)



\
 
 \ /
  Last update: 2009-08-07 05:29    [W:0.035 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site