lkml.org 
[lkml]   [2009]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] tracing/filters: strloc should be unsigned short
From
2009/5/29 Li Zefan <lizf@cn.fujitsu.com>:
> I forgot to update filter code accordingly in
> "tracing/events: change the type of __str_loc_item to unsigned short"
> (commt b0aae68cc5508f3c2fbf728988c954db4c8b8a53)
>
> It can cause system crash:
>
>  # echo 1 > tracing/events/irq/irq_handler_entry/enable
>  # echo 'name == eth0' > /mnt/tracing/events/irq/irq_handler_entry/filter
>
> [ Impact: fix system crash while filtering on __string() field ]
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
>  kernel/trace/trace_events_filter.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
> index a7430b1..a854eed 100644
> --- a/kernel/trace/trace_events_filter.c
> +++ b/kernel/trace/trace_events_filter.c
> @@ -178,7 +178,7 @@ static int filter_pred_string(struct filter_pred *pred, void *event,
>  static int filter_pred_strloc(struct filter_pred *pred, void *event,
>                              int val1, int val2)
>  {
> -       int str_loc = *(int *)(event + pred->offset);
> +       unsigned short str_loc = *(unsigned short *)(event + pred->offset);


Ouch, indeed :-)

I will apply this one and send it to Ingo, thanks!


>        char *addr = (char *)(event + str_loc);
>        int cmp, match;
>
> --
> 1.5.4.rc3
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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