diff options
| author | Cheng-Min Chiang <chmnchiang@google.com> | 2020-07-24 18:05:18 -0700 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-08-07 09:28:26 +0200 |
| commit | 20a3465b973bec140ff12740acffa6c357b27edc (patch) | |
| tree | 055bd8837d2f68319165366dfc273ea8b891a92c /pkg/host/syscalls_linux.go | |
| parent | cb436c69d9bcb0330518a48559649c9436ed5e7a (diff) | |
sys/linux: add descriptions for BPF LSM
This commit includes the following changes:
* executor: add a new syz_btf_id_by_name psuedo-syscall
* sys/linux: add descriptions for BPF LSM subsystem
* sys/linux: add instructions on how to dump vmlinux and install
bpftool
* sys/linux/test: add tests for the new psuedo-syscall
* pkg/host: add support detection for the new psuedo-syscall
* pkg/runtest: skip the coverage test when invoking the new
psuedo-syscall
Update #533.
Diffstat (limited to 'pkg/host/syscalls_linux.go')
| -rw-r--r-- | pkg/host/syscalls_linux.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go index f1c8f03c8..06e9a261f 100644 --- a/pkg/host/syscalls_linux.go +++ b/pkg/host/syscalls_linux.go @@ -243,6 +243,13 @@ func isSyzIoUringSupported(c *prog.Syscall, target *prog.Target, sandbox string) return isSupportedSyscall(ioUringSyscall, target) } +func isBtfVmlinuxSupported(c *prog.Syscall, target *prog.Target, sandbox string) (bool, string) { + if err := osutil.IsAccessible("/sys/kernel/btf/vmlinux"); err != nil { + return false, err.Error() + } + return onlySandboxNone(sandbox) +} + var syzkallSupport = map[string]func(*prog.Syscall, *prog.Target, string) (bool, string){ "syz_open_dev": isSyzOpenDevSupported, "syz_open_procfs": alwaysSupported, @@ -267,7 +274,8 @@ var syzkallSupport = map[string]func(*prog.Syscall, *prog.Target, string) (bool, "syz_io_uring_setup": isSyzIoUringSupported, // syz_memcpy_off is only used for io_uring descriptions, thus, enable it // only if io_uring syscalls are enabled. - "syz_memcpy_off": isSyzIoUringSupported, + "syz_memcpy_off": isSyzIoUringSupported, + "syz_btf_id_by_name": isBtfVmlinuxSupported, } func isSupportedSyzkall(c *prog.Syscall, target *prog.Target, sandbox string) (bool, string) { |
