lkml.org 
[lkml]   [2013]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drm/i915: Fix refcount leak and possible NULL pointer dereference.
On Tue, Dec 24, 2013 at 08:50:23PM +0900, Tetsuo Handa wrote:
> >From 482be6384379072eb4c0d45d0ab8a25df4f59ed7 Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Date: Tue, 24 Dec 2013 18:04:14 +0900
> Subject: [PATCH] drm/i915: Fix refcount leak and possible NULL pointer dereference.
>
> Since get_pid_task() grabs a reference on the task_struct, we have to drop the
> refcount after reading that task's comm name. Also, directly reading like
> get_pid_task()->comm can trigger an oops when get_pid_task() returned NULL.

The second issue is moot as file itself cannot exist if the task_struct
is NULL, and the task_struct cannot be destroyed until we finish the
function. The simpler fix would appear to be s/get_pid_task/pid_task/
-Chris

--
Chris Wilson, Intel Open Source Technology Centre


\
 
 \ /
  Last update: 2013-12-25 23:21    [W:0.073 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site