lkml.org 
[lkml]   [2009]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 2/7] tracing/filters: fix NULL pointer dereference
    Try this, and you'll see NULL pointer dereference bug:
    # echo -n 'parent_comm ==' > sched/sched_process_fork/filter

    Because we passed NULL ptr to simple_strtoull().

    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    ---
    kernel/trace/trace_events_filter.c | 5 +++++
    1 files changed, 5 insertions(+), 0 deletions(-)

    diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
    index 026be41..9d2162f 100644
    --- a/kernel/trace/trace_events_filter.c
    +++ b/kernel/trace/trace_events_filter.c
    @@ -410,6 +410,11 @@ int filter_parse(char **pbuf, struct filter_pred *pred)
    }
    }

    + if (!val_str) {
    + pred->field_name = NULL;
    + return -EINVAL;
    + }
    +
    pred->field_name = kstrdup(pred->field_name, GFP_KERNEL);
    if (!pred->field_name)
    return -ENOMEM;
    --
    1.5.4.rc3


    \
     
     \ /
      Last update: 2009-04-11 09:55    [W:0.019 / U:3.124 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site