linux/fs/proc
Oleg Nesterov b95c35e76b oom: fix the unsafe usage of badness() in proc_oom_score()
proc_oom_score(task) has a reference to task_struct, but that is all.
If this task was already released before we take tasklist_lock

	- we can't use task->group_leader, it points to nowhere

	- it is not safe to call badness() even if this task is
	  ->group_leader, has_intersects_mems_allowed() assumes
	  it is safe to iterate over ->thread_group list.

	- even worse, badness() can hit ->signal == NULL

Add the pid_alive() check to ensure __unhash_process() was not called.

Also, use "task" instead of task->group_leader. badness() should return
the same result for any sub-thread. Currently this is not true, but
this should be changed anyway.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-04-01 08:50:21 -07:00
..
array.c fs: use rlimit helpers 2010-03-06 11:26:29 -08:00
base.c oom: fix the unsafe usage of badness() in proc_oom_score() 2010-04-01 08:50:21 -07:00
cmdline.c
cpuinfo.c
devices.c
generic.c proc: warn on non-existing proc entries 2010-03-06 11:26:45 -08:00
inode.c proc: rename de_get() to pde_get() and inline it 2009-12-16 07:19:57 -08:00
internal.h proc: rename de_get() to pde_get() and inline it 2009-12-16 07:19:57 -08:00
interrupts.c
Kconfig
kcore.c kcore: fix test for end of list 2010-03-24 16:31:22 -07:00
kmsg.c syslog: use defined constants instead of raw numbers 2010-02-04 14:20:41 +11:00
loadavg.c
Makefile
meminfo.c hwpoison: fix/proc/meminfo alignment 2009-10-29 07:39:25 -07:00
mmu.c
nommu.c
page.c mm: export stable page flags 2009-12-16 12:19:59 +01:00
proc_devtree.c proc_devtree: fix THIS_MODULE without module.h 2010-02-14 07:13:41 -07:00
proc_net.c
proc_sysctl.c sysctl: Don't look at ctl_name and strategy in the generic code 2009-11-11 00:53:43 -08:00
proc_tty.c
root.c some clean up in fs/proc 2010-03-03 13:00:18 -05:00
softirqs.c
stat.c sched, cpuacct: Fix niced guest time accounting 2009-10-25 17:31:30 +01:00
task_mmu.c mm: count swap usage 2010-03-06 11:26:24 -08:00
task_nommu.c procfs: use proper units for noMMU statm 2009-12-15 08:53:24 -08:00
uptime.c
version.c
vmcore.c