From f07ea3fc223b56f47547f7c94ca5f50154e3b6be Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 20 Nov 2017 17:23:24 +0100 Subject: sys/linux: remove get_kernel_syms, add quotactl syscall get_kernel_syms does not seem to be present upstream. Describe an old quotactl syscall. Also fix umount/umount2 names in kallsyms. --- pkg/host/host_linux.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pkg/host/host_linux.go') diff --git a/pkg/host/host_linux.go b/pkg/host/host_linux.go index 6da153f2d..3c2a3156f 100644 --- a/pkg/host/host_linux.go +++ b/pkg/host/host_linux.go @@ -54,7 +54,19 @@ func isSupported(kallsyms []byte, c *prog.Syscall) bool { if len(kallsyms) == 0 { return true } - return bytes.Index(kallsyms, []byte(" T sys_"+c.CallName+"\n")) != -1 + name := c.CallName + if newname := kallsymsMap[name]; newname != "" { + name = newname + } + return bytes.Index(kallsyms, []byte(" T sys_"+name+"\n")) != -1 +} + +// Some syscall names diverge in __NR_* consts and kallsyms. +// umount2 is renamed to umount in arch/x86/entry/syscalls/syscall_64.tbl. +// Where umount is renamed to oldumount is unclear. +var kallsymsMap = map[string]string{ + "umount": "oldumount", + "umount2": "umount", } func isSupportedSyzkall(c *prog.Syscall) bool { -- cgit mrf-deployment