lkml.org 
[lkml]   [2009]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/1] perf_event: add check for group_list if the parent isn't counted
    Date
    If the parent has no entry in group_list, child_ctx will not be
    allocated, which will lead dereference of a NULL child_ctx.

    Signed-off-by: Liming Wang <liming.wang@windriver.com>
    ---
    kernel/perf_event.c | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/kernel/perf_event.c b/kernel/perf_event.c
    index 5b987b4..3664c4b 100644
    --- a/kernel/perf_event.c
    +++ b/kernel/perf_event.c
    @@ -5126,6 +5126,8 @@ int perf_event_init_task(struct task_struct *child)
    */
    mutex_lock(&parent_ctx->mutex);

    + if (list_empty(&parent_ctx->group_list))
    + goto exit;
    /*
    * We dont have to disable NMIs - we are only looking at
    * the list, not manipulating it:
    --
    1.6.0.3


    \
     
     \ /
      Last update: 2009-12-30 12:57    [W:7.697 / U:0.780 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site