diff options
| author | Mara Mihali <maramihali@google.com> | 2021-07-21 08:26:40 +0000 |
|---|---|---|
| committer | maramihali <maramihali@google.com> | 2021-07-22 14:14:36 +0300 |
| commit | 302e51de43c05797424da429336824f6b87c3353 (patch) | |
| tree | ddc1adcfbe792d88e67846282d48412c41a70645 /syz-verifier | |
| parent | 241790bb6f90cf276f6d68a7c6768be40880bef1 (diff) | |
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.
Diffstat (limited to 'syz-verifier')
| -rw-r--r-- | syz-verifier/verifier.go | 10 |
1 files changed, 8 insertions, 2 deletions
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 { |
