From 7b544c16beaa1f6ec70a72d53fe84cae95f70a41 Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Thu, 25 Nov 2010 13:29:31 +0100 Subject: bugfix: fix out-of-bound array access in cedf_activate_plugin() Make sure to check for maximum index value when accessing cedf_domain_t array in cedf_activate_plugin(). Reported-by: Jeremy Erickson --- litmus/sched_cedf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index 111e4fb1c62b..8c9513d33f59 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c @@ -708,7 +708,8 @@ static long cedf_activate_plugin(void) if (cpumask_test_cpu(cpu, cedf[j].cpu_map)) break; /* if it is in a cluster go to next cpu */ - if (cpumask_test_cpu(cpu, cedf[j].cpu_map)) + if (j < num_clusters && + cpumask_test_cpu(cpu, cedf[j].cpu_map)) continue; /* this cpu isn't in any cluster */ -- cgit v1.2.2