aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/syscalls_linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-01-17 14:15:13 +0100
committerDmitry Vyukov <dvyukov@google.com>2022-01-19 09:10:50 +0100
commit11e98f1831460925fbcd80af11c894b30823e414 (patch)
tree909309cfd23358fce6bdfe62a1f0bc7f086e5804 /pkg/host/syscalls_linux.go
parente333a0e2fc94aa27a735e62e713402c21eb2c0ef (diff)
executor: add extension point for adding non-mainline pseudo-syscalls
Add an empty common_ext.h which is included into executor and C reproducers and can be used to add non-mainline pseudo-syscalls w/o changing any other files (by replacing common_ext.h file). It would be good to finish #2274 which allows to add pseudo-syscalls along with *.txt descriptions, but #2274 is large and there are several open design questions. So add this simple extension point for now.
Diffstat (limited to 'pkg/host/syscalls_linux.go')
-rw-r--r--pkg/host/syscalls_linux.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go
index c628d20ab..6425fcce7 100644
--- a/pkg/host/syscalls_linux.go
+++ b/pkg/host/syscalls_linux.go
@@ -327,6 +327,14 @@ func isSupportedSyzkall(c *prog.Syscall, target *prog.Target, sandbox string) (b
return ok, reason
}
}
+ if strings.HasPrefix(c.CallName, "syz_ext_") {
+ // Non-mainline pseudo-syscalls in executor/common_ext.h can't have the checking function
+ // and are assumed to be unconditionally supported.
+ if syzkallSupport[c.CallName] != nil {
+ panic("syz_ext_ prefix is reserved for non-mainline pseudo-syscalls")
+ }
+ return true, ""
+ }
if isSupported, ok := syzkallSupport[c.CallName]; ok {
return isSupported(c, target, sandbox)
}