From 421e1cbedb47cb499201512defc2baf79d7b87f7 Mon Sep 17 00:00:00 2001 From: Pimyn Girgis Date: Tue, 6 Aug 2024 14:10:45 +0000 Subject: 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. --- pkg/vminfo/linux_syscalls.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pkg/vminfo/linux_syscalls.go') 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) -- cgit mrf-deployment