From 52c1f8045c38bcce0229b2cc3c69b1cbe21eb629 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 18 Sep 2024 17:38:12 +0200 Subject: sys/linux: add syz_create_resource syz_create_resource allows to turn any value into a resource. Improve binfmt descriptions using syz_create_resource: we need to pass the same file name to write syscalls and execve. Use syz_create_resource to improve binfmt descriptions. --- pkg/vminfo/linux_syscalls.go | 1 + pkg/vminfo/syscalls.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/vminfo') diff --git a/pkg/vminfo/linux_syscalls.go b/pkg/vminfo/linux_syscalls.go index 2b02ad7f9..0effafa33 100644 --- a/pkg/vminfo/linux_syscalls.go +++ b/pkg/vminfo/linux_syscalls.go @@ -100,6 +100,7 @@ var linuxSyscallChecks = map[string]func(*checkContext, *prog.Syscall) string{ "syz_pkey_set": linuxPkeysSupported, "syz_socket_connect_nvme_tcp": linuxSyzSocketConnectNvmeTCPSupported, "syz_pidfd_open": alwaysSupported, + "syz_create_resource": alwaysSupported, } func linuxSyzOpenDevSupported(ctx *checkContext, call *prog.Syscall) string { diff --git a/pkg/vminfo/syscalls.go b/pkg/vminfo/syscalls.go index 707ab6543..21ae6edd1 100644 --- a/pkg/vminfo/syscalls.go +++ b/pkg/vminfo/syscalls.go @@ -283,7 +283,7 @@ func extractStringConst(typ prog.Type, isAutomatic bool) (string, bool) { } ptr, ok := typ.(*prog.PtrType) if !ok { - panic("first open arg is not a pointer to string const") + return "", false } str, ok := ptr.Elem.(*prog.BufferType) if !ok || str.Kind != prog.BufferString || len(str.Values) == 0 { -- cgit mrf-deployment