aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource.go
diff options
context:
space:
mode:
authorAlexander Egorenkov <Alexander.Egorenkov@ibm.com>2020-06-02 09:18:07 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-06-25 23:08:45 +0200
commitaea82c003a1826ebd9bf53194bb40fe911f9c23e (patch)
treeb553b2118a605c2df9e8ac6def779377f310e0ae /pkg/csource/csource.go
parentf9147b0836f6cd4196dbc25509e8763435cc857a (diff)
sys/linux: first 64bit big-endian architecture s390x
* mmap syscall is special on Linux s390x because the parameters for this syscall are passed as a struct on user stack instead of registers. * Introduce the SyscallTrampolines table into targets.Target to address the above problem. * There is a bug in Linux kernel s390x which causes QEMU TCG to hang when KASAN is enabled. The bug has been fixed in the forthcoming Linux 5.8 version. Until then do not enable KASAN when using QEMU TCG, QEMU KVM shall have no problems with KASAN. Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
Diffstat (limited to 'pkg/csource/csource.go')
-rw-r--r--pkg/csource/csource.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index d2ab513cc..8818e4f1c 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -209,7 +209,8 @@ func (ctx *context) generateCalls(p prog.ExecProg, trace bool) ([]string, []uint
func (ctx *context) emitCall(w *bytes.Buffer, call prog.ExecCall, ci int, haveCopyout, trace bool) {
callName := call.Meta.CallName
- native := ctx.sysTarget.SyscallNumbers && !strings.HasPrefix(callName, "syz_")
+ _, trampoline := ctx.sysTarget.SyscallTrampolines[callName]
+ native := ctx.sysTarget.SyscallNumbers && !strings.HasPrefix(callName, "syz_") && !trampoline
fmt.Fprintf(w, "\t")
if haveCopyout || trace {
fmt.Fprintf(w, "res = ")
@@ -269,6 +270,8 @@ func (ctx *context) emitCallName(w *bytes.Buffer, call prog.ExecCall, native boo
fmt.Fprintf(w, "syscall(%v%v", ctx.sysTarget.SyscallPrefix, callName)
} else if strings.HasPrefix(callName, "syz_") {
fmt.Fprintf(w, "%v(", callName)
+ } else if trampolineName, ok := ctx.sysTarget.SyscallTrampolines[callName]; ok {
+ fmt.Fprintf(w, "%v(", trampolineName)
} else {
args := strings.Repeat(",intptr_t", len(call.Args))
if args != "" {