aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vminfo/features.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-05-07 17:04:45 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-05-16 15:38:27 +0000
commitb6954dce2f21b8feb1448edaaeeefc22f5ff4944 (patch)
tree6f4358ba6609826b614847707e180662d986f98e /pkg/vminfo/features.go
parentf694ecdc179cf43429135188934eed687ae28645 (diff)
pkg/vminfo: run programs interactively
Use the same interfaces as the fuzzer. Now syz-manager no longer needs to treat machine check executions differently.
Diffstat (limited to 'pkg/vminfo/features.go')
-rw-r--r--pkg/vminfo/features.go22
1 files changed, 16 insertions, 6 deletions
diff --git a/pkg/vminfo/features.go b/pkg/vminfo/features.go
index 2ba76a255..ab71e1168 100644
--- a/pkg/vminfo/features.go
+++ b/pkg/vminfo/features.go
@@ -8,8 +8,8 @@ import (
"strings"
"github.com/google/syzkaller/pkg/flatrpc"
+ "github.com/google/syzkaller/pkg/fuzzer/queue"
"github.com/google/syzkaller/pkg/ipc"
- "github.com/google/syzkaller/pkg/rpctype"
"github.com/google/syzkaller/prog"
)
@@ -46,14 +46,24 @@ type featureResult struct {
reason string
}
-func (ctx *checkContext) checkFeatures() {
+func (ctx *checkContext) startFeaturesCheck() {
testProg := ctx.target.DataMmapProg()
for feat := range flatrpc.EnumNamesFeature {
feat := feat
- ctx.pendingRequests++
go func() {
envFlags, execFlags := ctx.featureToFlags(feat)
- res := ctx.execProg(testProg, envFlags, execFlags)
+ req := &queue.Request{
+ Prog: testProg,
+ ReturnOutput: true,
+ ReturnError: true,
+ ExecOpts: &ipc.ExecOpts{
+ EnvFlags: envFlags,
+ ExecFlags: execFlags,
+ SandboxArg: ctx.cfg.SandboxArg,
+ },
+ }
+ ctx.executor.Submit(req)
+ res := req.Wait(ctx.ctx)
reason := ctx.featureSucceeded(feat, testProg, res)
ctx.features <- featureResult{feat, reason}
}()
@@ -161,8 +171,8 @@ func (ctx *checkContext) featureToFlags(feat flatrpc.Feature) (ipc.EnvFlags, ipc
// This generally checks that just all syscalls were executed and succeed,
// for coverage features we also check that we got actual coverage.
func (ctx *checkContext) featureSucceeded(feat flatrpc.Feature, testProg *prog.Prog,
- res rpctype.ExecutionResult) string {
- if res.Error != "" {
+ res *queue.Result) string {
+ if res.Status != queue.Success {
if len(res.Output) != 0 {
return string(res.Output)
}