alistair23-linux/fs/proc
Hiroshi Shimamoto ae0027869d latencytop: fix kernel panic while reading latency proc file
Reading /proc/<pid>/latency or /proc/<pid>/task/<tid>/latency could cause
NULL pointer dereference.

In lstats_open(), get_proc_task() can return NULL, in which case the kernel
will oops at lstats_show_proc() because m->private is NULL.

When get_proc_task() returns NULL, the kernel should return -ENOENT.

This can be reproduced by the following script.
while :
do
        date
        bash -c 'ls > ls.$$' &
        pid=$!
        cat /proc/$pid/latency &
        cat /proc/$pid/latency &
        cat /proc/$pid/latency &
        cat /proc/$pid/latency
done

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-02-25 16:34:17 +01:00
..
array.c proc: seqfile convert proc_pid_status to properly handle pid namespaces 2008-02-08 09:22:24 -08:00
base.c latencytop: fix kernel panic while reading latency proc file 2008-02-25 16:34:17 +01:00
generic.c proc: fix ->open'less usage due to ->proc_fops flip 2008-02-08 09:22:24 -08:00
inode-alloc.txt
inode.c proc: remove MODULE_LICENSE 2008-02-08 09:22:23 -08:00
internal.h d_path: Make proc_get_link() use a struct path argument 2008-02-14 21:17:08 -08:00
kcore.c aout: remove unnecessary inclusions of {asm, linux}/a.out.h 2008-02-08 09:22:30 -08:00
kmsg.c
Makefile
mmu.c
nommu.c d_path: Make seq_path() use a struct path argument 2008-02-14 21:17:08 -08:00
proc_devtree.c
proc_misc.c procfs: constify function pointer tables 2008-02-08 09:22:38 -08:00
proc_net.c proc: fix ->open'less usage due to ->proc_fops flip 2008-02-08 09:22:24 -08:00
proc_sysctl.c Embed a struct path into struct nameidata instead of nd->{dentry,mnt} 2008-02-14 21:13:33 -08:00
proc_tty.c procfs: constify function pointer tables 2008-02-08 09:22:38 -08:00
root.c proc: fix ->open'less usage due to ->proc_fops flip 2008-02-08 09:22:24 -08:00
task_mmu.c /proc/pid/pagemap: fix PM_SPECIAL macro 2008-02-23 17:12:13 -08:00
task_nommu.c d_path: Make proc_get_link() use a struct path argument 2008-02-14 21:17:08 -08:00
vmcore.c aout: remove unnecessary inclusions of {asm, linux}/a.out.h 2008-02-08 09:22:30 -08:00