aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vminfo
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-05-17 17:20:45 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-05-21 09:46:36 +0000
commit1d3c25e7679384c386e7710ea11e364ce9f9e028 (patch)
treec154a9578f63037babef096e85fe9a34183ee640 /pkg/vminfo
parenta38fb99b3fbff0c988e64bf4bf277071e18b18af (diff)
pkg/ipc: remove ProgInfo
Switch to flatrpc.ProgInfo. Note: this disables syz-runtest and syz-verifier.
Diffstat (limited to 'pkg/vminfo')
-rw-r--r--pkg/vminfo/features.go4
-rw-r--r--pkg/vminfo/syscalls.go18
-rw-r--r--pkg/vminfo/vminfo_test.go8
3 files changed, 14 insertions, 16 deletions
diff --git a/pkg/vminfo/features.go b/pkg/vminfo/features.go
index 3b7bae8d5..905fc630f 100644
--- a/pkg/vminfo/features.go
+++ b/pkg/vminfo/features.go
@@ -186,8 +186,8 @@ func (ctx *checkContext) featureSucceeded(feat flatrpc.Feature, testProg *prog.P
len(res.Info.Calls), len(testProg.Calls))
}
for i, call := range res.Info.Calls {
- if call.Errno != 0 {
- return fmt.Sprintf("call %v failed with errno %v", i, call.Errno)
+ if call.Error != 0 {
+ return fmt.Sprintf("call %v failed with errno %v", i, call.Error)
}
}
call := res.Info.Calls[0]
diff --git a/pkg/vminfo/syscalls.go b/pkg/vminfo/syscalls.go
index f6ab24a04..23c9504e2 100644
--- a/pkg/vminfo/syscalls.go
+++ b/pkg/vminfo/syscalls.go
@@ -140,7 +140,7 @@ func (ctx *checkContext) canOpenImpl(file string, modes []uint64, root bool) str
}
info := ctx.execRaw(calls, prog.StrictUnsafe, root)
for _, call := range info.Calls {
- if call.Errno == 0 {
+ if call.Error == 0 {
return ""
}
}
@@ -148,7 +148,7 @@ func (ctx *checkContext) canOpenImpl(file string, modes []uint64, root bool) str
if root {
who = "root "
}
- return fmt.Sprintf("%vfailed to open %s: %v", who, file, syscall.Errno(info.Calls[0].Errno))
+ return fmt.Sprintf("%vfailed to open %s: %v", who, file, syscall.Errno(info.Calls[0].Error))
}
func (ctx *checkContext) supportedSyscalls(names []string) string {
@@ -161,7 +161,7 @@ func (ctx *checkContext) supportedSyscalls(names []string) string {
}
info := ctx.execRaw(calls, prog.NonStrictUnsafe, false)
for i, res := range info.Calls {
- if res.Errno == int(syscall.ENOSYS) {
+ if res.Error == int32(syscall.ENOSYS) {
return fmt.Sprintf("syscall %v is not present", names[i])
}
}
@@ -201,17 +201,17 @@ func (ctx *checkContext) callSucceeds(call string) string {
func (ctx *checkContext) execCall(call string) syscall.Errno {
info := ctx.execRaw([]string{call}, prog.StrictUnsafe, false)
- return syscall.Errno(info.Calls[0].Errno)
+ return syscall.Errno(info.Calls[0].Error)
}
func (ctx *checkContext) anyCallSucceeds(calls []string, msg string) string {
info := ctx.execRaw(calls, prog.StrictUnsafe, false)
for _, call := range info.Calls {
- if call.Errno == 0 {
+ if call.Error == 0 {
return ""
}
}
- return fmt.Sprintf("%s: %v", msg, syscall.Errno(info.Calls[0].Errno))
+ return fmt.Sprintf("%s: %v", msg, syscall.Errno(info.Calls[0].Error))
}
func (ctx *checkContext) onlySandboxNone() string {
@@ -236,12 +236,12 @@ func (ctx *checkContext) val(name string) uint64 {
return val
}
-func (ctx *checkContext) execRaw(calls []string, mode prog.DeserializeMode, root bool) *ipc.ProgInfo {
+func (ctx *checkContext) execRaw(calls []string, mode prog.DeserializeMode, root bool) *flatrpc.ProgInfo {
sandbox := ctx.sandbox
if root {
sandbox = 0
}
- info := &ipc.ProgInfo{}
+ info := &flatrpc.ProgInfo{}
for remain := calls; len(remain) != 0; {
// Don't put too many syscalls into a single program,
// it will have higher chances to time out.
@@ -267,7 +267,7 @@ func (ctx *checkContext) execRaw(calls []string, mode prog.DeserializeMode, root
info.Calls = append(info.Calls, res.Info.Calls...)
} else if res.Status == queue.Crashed {
// Pretend these calls were not executed.
- info.Calls = append(info.Calls, ipc.EmptyProgInfo(ncalls).Calls...)
+ info.Calls = append(info.Calls, flatrpc.EmptyProgInfo(ncalls).Calls...)
} else {
// The program must have been either executed or not due to a crash.
panic(fmt.Sprintf("got unexpected execution status (%d) for the prog %s",
diff --git a/pkg/vminfo/vminfo_test.go b/pkg/vminfo/vminfo_test.go
index b73a6ad66..0e5d17ef2 100644
--- a/pkg/vminfo/vminfo_test.go
+++ b/pkg/vminfo/vminfo_test.go
@@ -103,14 +103,12 @@ func createSuccessfulResults(source queue.Source, stop chan struct{}) {
// Currently we have 641 (when we failed to properly dedup syscall tests, it was 4349).
panic("too many test programs")
}
- info := &ipc.ProgInfo{}
+ info := &flatrpc.ProgInfo{}
for range req.Prog.Calls {
- info.Calls = append(info.Calls, ipc.CallInfo{
+ info.Calls = append(info.Calls, &flatrpc.CallInfo{
Cover: []uint32{1},
Signal: []uint32{1},
- Comps: map[uint64]map[uint64]bool{
- 1: {2: true},
- },
+ Comps: []*flatrpc.Comparison{{Op1: 1, Op2: 2}},
})
}
req.Done(&queue.Result{