fuzz, vmm: Avoid infinite loop in CMOS fuzzer

With the addition of the spinning waiting for the exit event to be
received in the CMOS device a regression was introduced into the CMOS
fuzzer. Since there is nothing to receive the event in the fuzzer and
there is nothing to update the bit the that the device is looping on;
introducing an infinite loop.

Use an Option<> type so that when running the device in the fuzzer no
Arc<AtomicBool> is provided effectively disabling the spinning logic.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61165

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford
2023-08-05 09:43:12 +01:00
committed by Bo Chen
parent 6ee7bfdd50
commit a00d29867c
3 changed files with 12 additions and 10 deletions

View File

@@ -27,7 +27,7 @@ fuzz_target!(|bytes| {
u64::from_le_bytes(below_4g),
u64::from_le_bytes(above_4g),
EventFd::new(EFD_NONBLOCK).unwrap(),
Arc::new(AtomicBool::default()),
None,
);
let mut i = 16;