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
>>  	if (is_string_field(field)) {
>> + pred->str_len = field->size;
>> +
>> if (field->filter_type == FILTER_STATIC_STRING)
>> fn = filter_pred_string;
>> - else
>> + else if (field->filter_type == FILTER_DYN_STRING)
>> fn = filter_pred_strloc;
>> - pred->str_len = field->size;
>> + else {
>> + fn = filter_pred_pchar;
>> + pred->str_len = strlen(pred->str_val);
>> + }
>
> I'm a little dense here, where do we protect against someone making a
> tracepoint that points to unsafe data?
>

We can't prevent anyone from doing insane things deliberately, but
we prevent from doing wrong things unconsciously.

Only if a TRACE_EVENT has a field defined as:

__field_ext(char *, name, FILTER_PTR_STR)

Here using FILTER_PTR_STR explicitly, he should know what he's doing.

Anyway, he can make a ptr pointing to unsafe data this way:

TP_STRUCT__entry(
__field(char *, name)
)
TP_printk("%s", name)



\
 
 \ /
  Last update: 2009-08-07 03:23    [from the cache]
©2003-2011 Jasper Spaans