kprobes: Sanitize struct kretprobe_instance allocations
authorAnanth N Mavinakayanahalli <ananth@in.ibm.com>
Fri, 30 Oct 2009 13:53:10 +0000 (19:23 +0530)
committerIngo Molnar <mingo@elte.hu>
Mon, 2 Nov 2009 16:00:18 +0000 (17:00 +0100)
commit4dae560f97fa438f373b53e14b30149c9e44a600
tree4408896d10c483e0f855636f8b9e208bd856d6fc
parent5e9b397292ca0b9409dced33e3a22ec993377064
kprobes: Sanitize struct kretprobe_instance allocations

For as long as kretprobes have existed, we've allocated NR_CPUS
instances of kretprobe_instance structures. With the default
value of CONFIG_NR_CPUS increasing on certain architectures, we
are potentially wasting kernel memory.

See http://sourceware.org/bugzilla/show_bug.cgi?id=10839#c3 for
more details.

Use a saner num_possible_cpus() instead of NR_CPUS for
allocation.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: fweisbec@gmail.com
LKML-Reference: <20091030135310.GA22230@in.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/kprobes.c