Xiaotian Feng a2ef990ab5 proc: fix null pointer deref in proc_pid_permission()
get_proc_task() can fail to search the task and return NULL,
put_task_struct() will then bomb the kernel with following oops:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
  IP: [<ffffffff81217d34>] proc_pid_permission+0x64/0xe0
  PGD 112075067 PUD 112814067 PMD 0
  Oops: 0002 [#1] PREEMPT SMP

This is a regression introduced by commit 0499680a ("procfs: add hidepid=
and gid= mount options").  The kernel should return -ESRCH if
get_proc_task() failed.

Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Vasiliy Kulikov <segoon@openwall.com>
Cc: Stephen Wilson <wilsons@start.ca>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-12 20:13:02 -08:00
..
2012-01-03 22:55:04 -05:00
2012-01-03 22:54:53 -05:00
2012-01-03 22:54:53 -05:00
2012-01-03 22:54:07 -05:00
2012-01-09 16:36:12 -05:00
2012-01-03 22:54:57 -05:00
2012-01-03 22:55:10 -05:00
2012-01-03 22:54:54 -05:00
2012-01-03 22:55:05 -05:00
2012-01-09 10:48:11 -05:00
2012-01-10 13:45:22 -08:00
2012-01-10 13:45:22 -08:00
2011-03-31 11:26:23 -03:00
2012-01-03 22:55:01 -05:00
2012-01-03 22:55:07 -05:00
2012-01-10 13:45:22 -08:00
2012-01-03 22:55:03 -05:00
2011-11-02 16:07:03 -07:00
2012-01-03 22:55:11 -05:00
2012-01-03 22:54:54 -05:00
2011-11-16 09:21:50 +01:00
2012-01-03 22:54:07 -05:00
2012-01-10 13:06:32 -05:00
2012-01-03 22:52:39 -05:00
2012-01-05 15:40:12 -08:00
2012-01-03 22:54:07 -05:00
2011-05-26 10:01:43 -06:00
2012-01-03 22:52:41 -05:00
2011-10-31 17:30:44 -07:00
2012-01-03 22:52:40 -05:00
2012-01-03 22:54:07 -05:00
2011-11-02 12:53:43 +01:00
2012-01-03 22:53:07 -05:00
2012-01-03 22:54:07 -05:00
2012-01-03 22:52:40 -05:00