Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6c5d0d4 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

sched/core: fix possible out-of-bounds access in updown_migrate_values()



In sched_update_updown_migrate_values(), while checking for elements
in cluster_cpus[], there is a possibility that we end up accessing
an element (i = MAX_CLUSTERS) which is out-of-bounds. Fix it by
updating the check.

Change-Id: Ia0587df9cf3add12475918171ea0578d99fa8782
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent fe96ce17
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6884,7 +6884,7 @@ static void sched_update_updown_migrate_values(unsigned int *data,
	int i, cpu;
	static const struct cpumask *cluster_cpus[MAX_CLUSTERS];

	for (i = cpu = 0; (!cluster_cpus[i]) &&
	for (i = cpu = 0; i < MAX_CLUSTERS &&
				cpu < num_possible_cpus(); i++) {
		cluster_cpus[i] = topology_possible_sibling_cpumask(cpu);
		cpu += cpumask_weight(topology_possible_sibling_cpumask(cpu));