diff options
author | Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> | 2008-02-14 10:26:24 -0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-25 16:34:17 +0100 |
commit | ae0027869db7d28563cd783865fab04ffd18419c (patch) | |
tree | 9d57da1dd823e9413fd539a4a60e09df6fe630f8 /Documentation/block | |
parent | 2d07b255c7b8a9723010e5c74778e058dc05162e (diff) | |
download | linux-ae0027869db7d28563cd783865fab04ffd18419c.tar.bz2 |
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>
Diffstat (limited to 'Documentation/block')
0 files changed, 0 insertions, 0 deletions