summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-09-01 15:31:14 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-03 02:04:36 +0000
commitac15a1562c185f3c48a5f988ca7beef974d22f44 (patch)
treebe07ab6005dc74c7c92ea61c91d812bb03d5a375
parent4417f398d9eaee16e9c08e5b231244b01ea745b1 (diff)
downloadvboot-ac15a1562c185f3c48a5f988ca7beef974d22f44.tar.gz
2stub: vb2ex_abort()s on host should abort(), not just exit()
Our keyblock and preamble fuzzers have been broken since CL:2353775, because they don't set up secdata in the context which the tested functions now depend upon. Unfortunately, we got no alerting about this... I only just happened to look at ClusterFuzz randomly today and saw an odd break in execution statistics around that date. With the new code as it is right now, all fuzzing attempts of the function end up running vb2ex_abort() from the uninitialized secdata. It would be great if the fuzzer could report every time it ends up in that function, but it doesn't seem to do that right now. Supposedly it reports "crashes", but I guess exit(1) is not a crash, so let's switch the line to abort() and see if that gets me the reporting behavior I want (before actually fixing the fuzzer). BRANCH=None BUG=None TEST=None Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Ie65838f30fa33a7602db253860afc8eeadcac4c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2389002 Reviewed-by: Joel Kitching <kitching@chromium.org>
-rw-r--r--firmware/2lib/2stub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c
index ed42f748..738092db 100644
--- a/firmware/2lib/2stub.c
+++ b/firmware/2lib/2stub.c
@@ -6,6 +6,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include "2api.h"
@@ -70,7 +71,7 @@ __attribute__((weak))
void vb2ex_abort(void)
{
/* Stub simply exits. */
- exit(1);
+ abort();
}
__attribute__((weak))