From c9f1854f3cf71f9e0dddcf2e7b69ba93558c2c32 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 15 Jun 2022 23:48:36 +0200 Subject: [PATCH] copy: safeguard start conditions --- kernel/mars_copy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/mars_copy.c b/kernel/mars_copy.c index d1079fcb..e5e18717 100644 --- a/kernel/mars_copy.c +++ b/kernel/mars_copy.c @@ -528,8 +528,10 @@ restart: /* This is the relgular starting state. * It must be zero, automatically entered via memset() */ - if ((unsigned long)READ_ONCE(st->table[0]) | - (unsigned long)READ_ONCE(st->table[1])) { + if ((READ_ONCE(st->active[0]) | + READ_ONCE(st->active[1])) || + ((unsigned long)READ_ONCE(st->table[0]) | + (unsigned long)READ_ONCE(st->table[1]))) { MARS_ERR("index %u not startable at pos=%lld\n", index, pos); progress = -EPROTO;