diff options
| author | Alexander Egorenkov <Alexander.Egorenkov@ibm.com> | 2020-06-02 09:18:07 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-06-25 23:08:45 +0200 |
| commit | aea82c003a1826ebd9bf53194bb40fe911f9c23e (patch) | |
| tree | b553b2118a605c2df9e8ac6def779377f310e0ae /pkg/csource | |
| parent | f9147b0836f6cd4196dbc25509e8763435cc857a (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')
| -rw-r--r-- | pkg/csource/csource.go | 5 | ||||
| -rw-r--r-- | pkg/csource/generated.go | 2 |
2 files changed, 6 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 != "" { diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 6c1f343be..e374b593f 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -5197,6 +5197,8 @@ struct fs_image_segment { #define sys_memfd_create 360 #elif GOARCH_mips64le #define sys_memfd_create 314 +#elif GOARCH_s390x +#define sys_memfd_create 350 #endif static unsigned long fs_image_segment_check(unsigned long size, unsigned long nsegs, long segments) |
