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
internal.h
interrupts.c
Kconfig
kcore.c kcore: fix test for end of list 2010-03-24 16:31:22 -07:00
kmsg.c
loadavg.c
Makefile
meminfo.c
mmu.c
nommu.c
page.c
proc_devtree.c
proc_net.c
proc_sysctl.c
proc_tty.c
root.c some clean up in fs/proc 2010-03-03 13:00:18 -05:00
softirqs.c
stat.c
task_mmu.c mm: count swap usage 2010-03-06 11:26:24 -08:00
task_nommu.c
uptime.c
version.c
vmcore.c