From 302e51de43c05797424da429336824f6b87c3353 Mon Sep 17 00:00:00 2001 From: Mara Mihali Date: Wed, 21 Jul 2021 08:26:40 +0000 Subject: syz-verifier: modify mismatches calculation Increment the number of Mismatches in Stats only once when mismatches are found for a system call, regardless of the number of kernels that returned mismatching ReturnStates because otherwise the number of mismatches would be incorrect and nondeterministic for more than two VMs. --- syz-verifier/verifier.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'syz-verifier') diff --git a/syz-verifier/verifier.go b/syz-verifier/verifier.go index f86106868..a9c584d46 100644 --- a/syz-verifier/verifier.go +++ b/syz-verifier/verifier.go @@ -88,19 +88,25 @@ func Verify(res []*Result, prog *prog.Prog, s *Stats) *ResultReport { pool0 := res[0].Pool for _, cr := range rr.Reports { cs := s.Calls[cr.Call] + + mismatch := false for _, state := range cr.States { // For each CallReport verify the ReturnStates from all the pools // that executed the program are the same if state0 := cr.States[pool0]; state0 != state { cr.Mismatch = true send = true + mismatch = true - s.TotalMismatches++ - cs.Mismatches++ cs.States[state] = true cs.States[state0] = true } } + + if mismatch { + cs.Mismatches++ + s.TotalMismatches++ + } } if send { -- cgit mrf-deployment