Skip to content

Commit d349f0e

Browse files
ebiggersgregkh
authored andcommitted
crypto: testmgr - add some more preemption points
[ Upstream commit e63e1b0 ] Call cond_resched() after each fuzz test iteration. This avoids stall warnings if fuzz_iterations is set very high for testing purposes. While we're at it, also call cond_resched() after finishing testing each test vector. Signed-off-by: Eric Biggers <ebiggers@google.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 09b9995 commit d349f0e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎crypto/testmgr.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,7 @@ static int test_hash_vec(const char *driver, const struct hash_testvec *vec,
12791279
req, tsgl, hashstate);
12801280
if (err)
12811281
return err;
1282+
cond_resched();
12821283
}
12831284
}
12841285
#endif
@@ -1493,6 +1494,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs,
14931494
err = test_hash_vec(driver, &vecs[i], i, req, tsgl, hashstate);
14941495
if (err)
14951496
goto out;
1497+
cond_resched();
14961498
}
14971499
err = test_hash_vs_generic_impl(driver, generic_driver, maxkeysize, req,
14981500
tsgl, hashstate);
@@ -1755,6 +1757,7 @@ static int test_aead_vec(const char *driver, int enc,
17551757
&cfg, req, tsgls);
17561758
if (err)
17571759
return err;
1760+
cond_resched();
17581761
}
17591762
}
17601763
#endif
@@ -1994,6 +1997,7 @@ static int test_aead(const char *driver, int enc,
19941997
tsgls);
19951998
if (err)
19961999
return err;
2000+
cond_resched();
19972001
}
19982002
return 0;
19992003
}
@@ -2336,6 +2340,7 @@ static int test_skcipher_vec(const char *driver, int enc,
23362340
&cfg, req, tsgls);
23372341
if (err)
23382342
return err;
2343+
cond_resched();
23392344
}
23402345
}
23412346
#endif
@@ -2535,6 +2540,7 @@ static int test_skcipher(const char *driver, int enc,
25352540
tsgls);
25362541
if (err)
25372542
return err;
2543+
cond_resched();
25382544
}
25392545
return 0;
25402546
}

0 commit comments

Comments
 (0)