syzkaller: github.com/google/syzkaller/sys/targets Index | Files

package targets

import "github.com/google/syzkaller/sys/targets"

Index

Package Files

common.go targets.go

Variables

var List = map[string]map[string]*Target{
    "test": {
        "64": {
            PtrSize:  8,
            PageSize: 4 << 10,

            CFlags: []string{"-m64", "-fsanitize=address", "-no-pie"},
            // contains filtered or unexported fields
        },
        "64_fork": {
            PtrSize:  8,
            PageSize: 8 << 10,

            CFlags: []string{"-m64", "-fsanitize=address", "-no-pie"},
            // contains filtered or unexported fields
        },
        "32_shmem": {
            PtrSize:        4,
            PageSize:       8 << 10,
            Int64Alignment: 4,
            CFlags:         []string{"-m32", "-static"},
            // contains filtered or unexported fields
        },
        "32_fork_shmem": {
            PtrSize:  4,
            PageSize: 4 << 10,
            CFlags:   []string{"-m32", "-static"},
            // contains filtered or unexported fields
        },
    },
    "linux": {
        "amd64": {
            PtrSize:          8,
            PageSize:         4 << 10,
            LittleEndian:     true,
            CFlags:           []string{"-m64"},
            Triple:           "x86_64-linux-gnu",
            KernelArch:       "x86_64",
            KernelHeaderArch: "x86",
            NeedSyscallDefine: func(nr uint64) bool {

                return nr >= 313
            },
        },
        "386": {
            VMArch:           "amd64",
            PtrSize:          4,
            PageSize:         4 << 10,
            Int64Alignment:   4,
            LittleEndian:     true,
            CFlags:           []string{"-m32"},
            Triple:           "x86_64-linux-gnu",
            KernelArch:       "i386",
            KernelHeaderArch: "x86",
        },
        "arm64": {
            PtrSize:          8,
            PageSize:         4 << 10,
            LittleEndian:     true,
            Triple:           "aarch64-linux-gnu",
            KernelArch:       "arm64",
            KernelHeaderArch: "arm64",
        },
        "arm": {
            VMArch:           "arm64",
            PtrSize:          4,
            PageSize:         4 << 10,
            LittleEndian:     true,
            CFlags:           []string{"-D__LINUX_ARM_ARCH__=6", "-march=armv6"},
            Triple:           "arm-linux-gnueabi",
            KernelArch:       "arm",
            KernelHeaderArch: "arm",
        },
        "mips64le": {
            VMArch:           "mips64le",
            PtrSize:          8,
            PageSize:         4 << 10,
            LittleEndian:     true,
            CFlags:           []string{"-march=mips64r2", "-mabi=64", "-EL"},
            Triple:           "mips64el-linux-gnuabi64",
            KernelArch:       "mips",
            KernelHeaderArch: "mips",
        },
        "ppc64le": {
            PtrSize:          8,
            PageSize:         64 << 10,
            LittleEndian:     true,
            CFlags:           []string{"-D__powerpc64__"},
            Triple:           "powerpc64le-linux-gnu",
            KernelArch:       "powerpc",
            KernelHeaderArch: "powerpc",
        },
        "s390x": {
            PtrSize:          8,
            PageSize:         4 << 10,
            LittleEndian:     false,
            Triple:           "s390x-linux-gnu",
            KernelArch:       "s390",
            KernelHeaderArch: "s390",
            SyscallTrampolines: map[string]string{

                "mmap": "mmap",
            },
        },
        "riscv64": {
            PtrSize:          8,
            PageSize:         4 << 10,
            LittleEndian:     true,
            Triple:           "riscv64-linux-gnu",
            KernelArch:       "riscv",
            KernelHeaderArch: "riscv",
        },
    },
    "freebsd": {
        "amd64": {
            PtrSize:           8,
            PageSize:          4 << 10,
            LittleEndian:      true,
            CCompiler:         "clang",
            CFlags:            []string{"-m64"},
            NeedSyscallDefine: dontNeedSyscallDefine,
        },
        "386": {
            VMArch:   "amd64",
            PtrSize:  4,
            PageSize: 4 << 10,

            DataOffset:        256 << 20,
            Int64Alignment:    4,
            LittleEndian:      true,
            CCompiler:         "clang",
            CFlags:            []string{"-m32"},
            NeedSyscallDefine: dontNeedSyscallDefine,
        },
    },
    "netbsd": {
        "amd64": {
            PtrSize:      8,
            PageSize:     4 << 10,
            LittleEndian: true,
            CFlags: []string{
                "-m64",
                "-static",
                "--sysroot", sourceDirVar + "/dest/",
            },
            CCompiler: sourceDirVar + "/tools/bin/x86_64--netbsd-g++",
        },
    },
    "openbsd": {
        "amd64": {
            PtrSize:      8,
            PageSize:     4 << 10,
            LittleEndian: true,
            CCompiler:    "c++",
            CFlags:       []string{"-m64", "-static", "-lutil"},
            NeedSyscallDefine: func(nr uint64) bool {
                switch nr {
                case 8:
                    return true
                case 94:
                    return true
                case 198:
                    return true
                case 295:
                    return true
                case 301:
                    return true
                case 302:
                    return true
                case 303:
                    return true
                case 304:
                    return true
                case 329:
                    return true
                case 330:
                    return true
                }
                return false
            },
        },
    },
    "fuchsia": {
        "amd64": {
            PtrSize:          8,
            PageSize:         4 << 10,
            LittleEndian:     true,
            KernelHeaderArch: "x64",
            CCompiler:        sourceDirVar + "/prebuilt/third_party/clang/linux-x64/bin/clang",
            Objdump:          sourceDirVar + "/prebuilt/third_party/clang/linux-x64/bin/llvm-objdump",
            CFlags:           fuchsiaCFlags("x64", "x86_64"),
        },
        "arm64": {
            PtrSize:          8,
            PageSize:         4 << 10,
            LittleEndian:     true,
            KernelHeaderArch: "arm64",
            CCompiler:        sourceDirVar + "/prebuilt/third_party/clang/linux-x64/bin/clang",
            Objdump:          sourceDirVar + "/prebuilt/third_party/clang/linux-x64/bin/llvm-objdump",
            CFlags:           fuchsiaCFlags("arm64", "aarch64"),
        },
    },
    "windows": {
        "amd64": {
            PtrSize: 8,

            PageSize:     4 << 10,
            LittleEndian: true,
        },
    },
    "akaros": {
        "amd64": {
            PtrSize:           8,
            PageSize:          4 << 10,
            LittleEndian:      true,
            KernelHeaderArch:  "x86",
            NeedSyscallDefine: dontNeedSyscallDefine,
            CCompiler:         sourceDirVar + "/toolchain/x86_64-ucb-akaros-gcc/bin/x86_64-ucb-akaros-g++",
            CFlags: []string{
                "-static",
            },
        },
    },
    "trusty": {
        "arm": {
            PtrSize:           4,
            PageSize:          4 << 10,
            LittleEndian:      true,
            NeedSyscallDefine: dontNeedSyscallDefine,
        },
    },
}

nolint: lll

func MakePosixMmap Uses

func MakePosixMmap(target *prog.Target, exec, contain bool) func() []*prog.Call

MakePosixMmap creates a "normal" posix mmap call that maps the target data range. If exec is set, the mapping is mapped as PROT_EXEC. If contain is set, the mapping is surrounded by PROT_NONE pages. These flags should be in sync with what executor.

func MakeSyzMmap Uses

func MakeSyzMmap(target *prog.Target) func() []*prog.Call

type Target Uses

type Target struct {
    OS               string
    Arch             string
    VMArch           string // e.g. amd64 for 386, or arm64 for arm
    PtrSize          uint64
    PageSize         uint64
    NumPages         uint64
    DataOffset       uint64
    Int64Alignment   uint64
    LittleEndian     bool
    CFlags           []string
    Triple           string
    CCompiler        string
    Objdump          string // name of objdump executable
    KernelCompiler   string // override CC when running kernel make
    KernelLinker     string // override LD when running kernel make
    KernelArch       string
    KernelHeaderArch string
    BrokenCompiler   string
    // NeedSyscallDefine is used by csource package to decide when to emit __NR_* defines.
    NeedSyscallDefine  func(nr uint64) bool
    HostEndian         binary.ByteOrder
    SyscallTrampolines map[string]string
    // contains filtered or unexported fields
}

func Get Uses

func Get(OS, arch string) *Target

type UnixNeutralizer Uses

type UnixNeutralizer struct {
    MAP_FIXED uint64
    S_IFREG   uint64
    S_IFCHR   uint64
    S_IFBLK   uint64
    S_IFIFO   uint64
    S_IFSOCK  uint64
}

func MakeUnixNeutralizer Uses

func MakeUnixNeutralizer(target *prog.Target) *UnixNeutralizer

func (*UnixNeutralizer) Neutralize Uses

func (arch *UnixNeutralizer) Neutralize(c *prog.Call)

Package targets imports 8 packages (graph) and is imported by 48 packages. Updated 2020-07-06. Refresh now. Tools for package owners.