aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vminfo/linux_syscalls.go
diff options
context:
space:
mode:
authorPimyn Girgis <bemenboshra2001@gmail.com>2024-08-06 14:10:45 +0000
committerDmitry Vyukov <dvyukov@google.com>2024-08-12 09:22:32 +0000
commit421e1cbedb47cb499201512defc2baf79d7b87f7 (patch)
treed3575138e30c98c96e6ecc180b4b06fdcd71fa4b /pkg/vminfo/linux_syscalls.go
parent1fef415f27727712346c8e7ad9c945e74d217b1b (diff)
pkg/mgrconfig, prog, tools: allow automatically generated or manually written descriptions or both
Add "Auto" type and allow to choose descriptions mode in configurations. Defaults to using manual only.
Diffstat (limited to 'pkg/vminfo/linux_syscalls.go')
-rw-r--r--pkg/vminfo/linux_syscalls.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/pkg/vminfo/linux_syscalls.go b/pkg/vminfo/linux_syscalls.go
index b27846e01..3f675c6a9 100644
--- a/pkg/vminfo/linux_syscalls.go
+++ b/pkg/vminfo/linux_syscalls.go
@@ -102,11 +102,12 @@ var linuxSyscallChecks = map[string]func(*checkContext, *prog.Syscall) string{
}
func linuxSyzOpenDevSupported(ctx *checkContext, call *prog.Syscall) string {
- if _, ok := call.Args[0].Type.(*prog.ConstType); ok {
+ if _, ok := call.Args[0].Type.(*prog.ConstType); ok || call.Attrs.Automatic {
// This is for syz_open_dev$char/block.
+ // second operand for when we have an automatically generated description
return ""
}
- fname, ok := extractStringConst(call.Args[0].Type)
+ fname, ok := extractStringConst(call.Args[0].Type, call.Attrs.Automatic)
if !ok {
panic("first open arg is not a pointer to string const")
}
@@ -192,7 +193,10 @@ func linuxSyzMountImageSupported(ctx *checkContext, call *prog.Syscall) string {
}
func linuxSupportedFilesystem(ctx *checkContext, call *prog.Syscall, fsarg int) string {
- fstype, ok := extractStringConst(call.Args[fsarg].Type)
+ if call.Attrs.Automatic {
+ return ""
+ }
+ fstype, ok := extractStringConst(call.Args[fsarg].Type, call.Attrs.Automatic)
if !ok {
panic(fmt.Sprintf("%v: filesystem is not string const", call.Name))
}
@@ -224,7 +228,7 @@ func linuxSyzReadPartTableSupported(ctx *checkContext, call *prog.Syscall) strin
}
func linuxSupportedSocket(ctx *checkContext, call *prog.Syscall) string {
- if call.Name == "socket" || call.Name == "socketpair" {
+ if call.Name == "socket" || call.Name == "socketpair" || call.Attrs.Automatic {
return "" // generic versions are always supported
}
af := uint64(0)