aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/runtest/run.go
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2024-12-10 13:38:43 +0100
committerAlexander Potapenko <glider@google.com>2024-12-11 10:23:54 +0000
commit09017703fac0755f8fc6362abe16a3206bccf333 (patch)
tree84279d9208c1542dcd605a5d59a24dbadc4a84ea /pkg/runtest/run.go
parentcfc402b4e65a6aab3a2555765bda8dc12c99a348 (diff)
pkg/vminfo: sys/linux: executor: define syz_kvm_assert_syzos_uexit()
The new pseudo-syscall will serve as a test assertion, checking the uexit return value. This is going to help us validate SyzOS code.
Diffstat (limited to 'pkg/runtest/run.go')
-rw-r--r--pkg/runtest/run.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go
index 213ce3f58..ca3ed3b4b 100644
--- a/pkg/runtest/run.go
+++ b/pkg/runtest/run.go
@@ -563,10 +563,19 @@ func checkCallResult(req *runRequest, isC bool, run, call int, info *flatrpc.Pro
if len(inf.Signal) < 2 && !calls[callName] && len(info.Extra.Signal) == 0 {
return fmt.Errorf("run %v: call %v: no signal", run, call)
}
- // syz_btf_id_by_name is a pseudo-syscall that might not provide
- // any coverage when invoked.
- if len(inf.Cover) == 0 && callName != "syz_btf_id_by_name" {
- return fmt.Errorf("run %v: call %v: no cover", run, call)
+ // Pseudo-syscalls that might not provide any coverage when invoked.
+ noCovSyscalls := []string{"syz_btf_id_by_name", "syz_kvm_assert_syzos_uexit"}
+ if len(inf.Cover) == 0 {
+ found := true
+ for _, s := range noCovSyscalls {
+ if callName == s {
+ found = true
+ break
+ }
+ }
+ if !found {
+ return fmt.Errorf("run %v: call %v: no cover", run, call)
+ }
}
calls[callName] = true
} else {