arinc653: avoid array overrun

Incrementing ->sched_index between bounds check and array access may
result in accessing one past the array when that is fully filled
(->num_schedule_entries == ARINC653_MAX_DOMAINS_PER_SCHEDULE).

Fixes: 22787f2e10 ("ARINC 653 scheduler")
Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
master commit: 5a1121633f
master date: 2026-03-26 10:47:41 +0100
This commit is contained in:
Jan Beulich committed 2026-04-20 12:20:23 +02:00
1 parent d174a86aaf
commit 646bcc17ce
1 file changed
+1 -4
+1 -4
View File
@@ -552,12 +552,9 @@ a653sched_do_schedule(
/* Switch minor frame or find correct minor frame after a miss */
while ( (now >= sched_priv->next_switch_time) &&
(sched_priv->sched_index < sched_priv->num_schedule_entries) )
{
sched_priv->sched_index++;
(++sched_priv->sched_index < sched_priv->num_schedule_entries) )
sched_priv->next_switch_time +=
sched_priv->schedule[sched_priv->sched_index].runtime;
}
/*
* If we exhausted the domains in the schedule and still have time left
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.