[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1201111348380.21755@chino.kir.corp.google.com>
Date: Wed, 11 Jan 2012 13:49:19 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Xiaotian Feng <xtfeng@...il.com>
cc: linux-kernel@...r.kernel.org,
Xiaotian Feng <dannyfeng@...cent.com>,
Al Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Vasiliy Kulikov <segoon@...nwall.com>,
Stephen Wilson <wilsons@...rt.ca>
Subject: Re: [PATCH] proc: fix null pointer deref in proc_pid_permission()
On Wed, 11 Jan 2012, Xiaotian Feng wrote:
> get_proc_task() can fail to search the task and return NULL, put_task_struct()
> will then bomb the kernel with following oops:
>
> [ 1870.574045] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
> [ 1870.574065] IP: [<ffffffff81217d34>] proc_pid_permission+0x64/0xe0
> [ 1870.574088] PGD 112075067 PUD 112814067 PMD 0
> [ 1870.574106] Oops: 0002 [#1] PREEMPT SMP
>
> This is a regression introduced by commit 0499680a, kernel should
> return -ESRCH if get_proc_task() failed.
>
> Signed-off-by: Xiaotian Feng <dannyfeng@...cent.com>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Vasiliy Kulikov <segoon@...nwall.com>
> Cc: Stephen Wilson <wilsons@...rt.ca>
> Cc: David Rientjes <rientjes@...gle.com>
Acked-by: David Rientjes <rientjes@...gle.com>
You're right to use -ESRCH so it matches the same behavior as the
remainder of /proc/pid when get_proc_task() returns NULL.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists