parser

package
v0.0.0-...-95e5f6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MapFixed   = "MAP_FIXED"
	RemapFixed = "MREMAP_FIXED"
)

Variables

View Source
var PreprocessMap = map[string]PreprocessHook{
	"bpf":         Preprocess_Bpf,
	"accept":      Preprocess_Accept,
	"accept4":     Preprocess_Accept,
	"bind":        Preprocess_Bind,
	"connect":     Preprocess_Connect,
	"fcntl":       Preprocess_Fcntl,
	"getsockname": Preprocess_Getsockname,
	"getsockopt":  Preprocess_Getsockopt,
	"ioctl":       Preprocess_Ioctl,
	"open":        Preprocess_Open,
	"prctl":       Preprocess_Prctl,
	"recvfrom":    Preprocess_Recvfrom,
	"mknod":       Preprocess_Mknod,
	"modify_ldt":  Preprocess_ModifyLdt,
	"openat":      Preprocess_Openat,
	"sendto":      Preprocess_Sendto,
	"setsockopt":  Preprocess_Setsockopt,
	"shmctl":      Preprocess_Shmctl,
	"socket":      Preprocess_Socket,
}
View Source
var SpecialStruct_Map = map[string]structHandler{
	"bpf_framed_program": bpfFramedProgramHandler,
}

Functions

func AddDependency

func AddDependency(start, length uint64, addr prog.Arg, ctx *Context)

func GenDefaultArg

func GenDefaultArg(syzType prog.Type, ctx *Context) prog.Arg

func GenDefaultStraceType

func GenDefaultStraceType(syzType prog.Type) strace_types.Type

func GetFixedFlag

func GetFixedFlag(ctx *Context) uint64

func GetProgs

func GetProgs(ctxs []*Context) []*prog.Prog

func IdentifyBpfInsn

func IdentifyBpfInsn(ctx *Context) int

func IdentifyIfconfUnion

func IdentifyIfconfUnion(ctx *Context) int

func IdentifyIfrIfruUnion

func IdentifyIfrIfruUnion(ctx *Context) int

func IdentifySockaddrNetlinkUnion

func IdentifySockaddrNetlinkUnion(ctx *Context) int

func IdentifySockaddrStorageUnion

func IdentifySockaddrStorageUnion(ctx *Context) int

func IdentifyUnionType

func IdentifyUnionType(ctx *Context, typeName string) int

func NewRCache

func NewRCache() returnCache

func ParseAddr

func ParseAddr(length uint64, syzType prog.Type, straceType strace_types.Type, ctx *Context) (prog.Arg, uint64)

func ParseFd

func ParseFd(syzType prog.Type, straceType strace_types.Type, ctx *Context) prog.Arg

func ParseFlags

func ParseFlags(syzType prog.Type, straceType strace_types.Type, ctx *Context, mapFlag bool) prog.Arg

func ParseInnerCall

func ParseInnerCall(syzType prog.Type, straceType *strace_types.Call, ctx *Context) prog.Arg

func ParseLength

func ParseLength(straceType strace_types.Type, ctx *Context) uint64

func ParseMadvise

func ParseMadvise(madvise *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseMemoryCall

func ParseMemoryCall(ctx *Context) *prog.Call

func ParseMlock

func ParseMlock(mlock *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseMmap

func ParseMmap(mmap *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseMprotect

func ParseMprotect(mprotect *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseMremap

func ParseMremap(mremap *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseMsync

func ParseMsync(msync *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseMunlock

func ParseMunlock(munlock *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseMunmap

func ParseMunmap(munmap *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func ParseShmat

func ParseShmat(shmat *prog.Syscall, syscall *strace_types.Syscall, ctx *Context) *prog.Call

func Parse_ArrayType

func Parse_ArrayType(syzType *prog.ArrayType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_BufferType

func Parse_BufferType(syzType *prog.BufferType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_ConstType

func Parse_ConstType(syzType prog.Type, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_ProcType

func Parse_ProcType(syzType *prog.ProcType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_PtrType

func Parse_PtrType(syzType *prog.PtrType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_ResourceType

func Parse_ResourceType(syzType *prog.ResourceType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_StructType

func Parse_StructType(syzType *prog.StructType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_UnionType

func Parse_UnionType(syzType *prog.UnionType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Parse_VmaType

func Parse_VmaType(syzType *prog.VmaType, straceType strace_types.Type, ctx *Context) (prog.Arg, error)

func Preprocess

func Preprocess(ctx *Context)

func PreprocessStruct

func PreprocessStruct(syzType *prog.StructType, straceType strace_types.Type, ctx *Context) strace_types.Type

func Preprocess_Accept

func Preprocess_Accept(ctx *Context)

func Preprocess_Bind

func Preprocess_Bind(ctx *Context)

func Preprocess_Bpf

func Preprocess_Bpf(ctx *Context)

func Preprocess_Connect

func Preprocess_Connect(ctx *Context)

func Preprocess_Fcntl

func Preprocess_Fcntl(ctx *Context)

func Preprocess_Getsockname

func Preprocess_Getsockname(ctx *Context)

func Preprocess_Getsockopt

func Preprocess_Getsockopt(ctx *Context)

func Preprocess_Ioctl

func Preprocess_Ioctl(ctx *Context)

func Preprocess_Mknod

func Preprocess_Mknod(ctx *Context)

func Preprocess_ModifyLdt

func Preprocess_ModifyLdt(ctx *Context)

func Preprocess_Open

func Preprocess_Open(ctx *Context)

func Preprocess_Openat

func Preprocess_Openat(ctx *Context)

func Preprocess_Prctl

func Preprocess_Prctl(ctx *Context)

func Preprocess_Recvfrom

func Preprocess_Recvfrom(ctx *Context)

func Preprocess_Sendto

func Preprocess_Sendto(ctx *Context)

func Preprocess_Setsockopt

func Preprocess_Setsockopt(ctx *Context)

func Preprocess_Shmctl

func Preprocess_Shmctl(ctx *Context)

func Preprocess_Socket

func Preprocess_Socket(ctx *Context)

func SanitizeFilename

func SanitizeFilename(filename string) string

Types

type Context

type Context struct {
	Cache             returnCache
	Prog              *prog.Prog
	CurrentStraceCall *strace_types.Syscall
	CurrentSyzCall    *prog.Call
	CurrentStraceArg  strace_types.Type
	State             *tracker.State
	Target            *prog.Target
	CallToCover       map[*prog.Call][]uint64
	DependsOn         map[*prog.Call]map[*prog.Call]int
}

func NewContext

func NewContext(target *prog.Target) (ctx *Context)

func ParseProg

func ParseProg(trace *strace_types.Trace, target *prog.Target) (*Context, error)

func (*Context) FillOutMemory

func (ctx *Context) FillOutMemory() bool

func (*Context) GenerateSeeds

func (ctx *Context) GenerateSeeds() distiller.Seeds

type PreprocessHook

type PreprocessHook func(ctx *Context)

type ResourceDescription

type ResourceDescription struct {
	Type string
	Val  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL