Documentation ¶
Index ¶
- Constants
- Variables
- func ConstArg(t prog.Type, v uint64) prog.Arg
- func DataArg(t prog.Type, data []byte) prog.Arg
- func GetSyzType(typ prog.Type) string
- func GroupArg(t prog.Type, inner []prog.Arg) prog.Arg
- func PointerArg(t prog.Type, page uint64, off int, npages uint64, obj prog.Arg) prog.Arg
- func ResultArg(t prog.Type, r prog.Arg, v uint64) prog.Arg
- func ReturnArg(t prog.Type) prog.Arg
- func UnionArg(t prog.Type, opt prog.Arg, typ prog.Type) prog.Arg
- type ArrayType
- type BinarySet
- type Binop
- type BufferType
- type Call
- type DynamicType
- type Expression
- type Field
- type FlagType
- type IntType
- type IpType
- type Macro
- type Operation
- type Pair
- type Parenthetical
- type PointerType
- type SocketDesc
- type StructType
- type Syscall
- type Trace
- type TraceTree
- type Type
- type Unop
Constants ¶
View Source
const ( OR = iota AND XOR NOT LSHIFT RSHIFT ONESCOMP TIMES LAND LOR LEQUAL )
Variables ¶
View Source
var ( Strace_ExpressionType = "Expression Type" Strace_CallType = "Call Type" Strace_IntType = "Int Type" Strace_FieldType = "Field Type" Strace_StructType = "Struct Type" Strace_ArrayType = "Array Type" Strace_PointerType = "Pointer Type" Strace_BufferType = "Buffer Type" Strace_FlagType = "Flag Type" Strace_Ipv4Type = "Ipv4 Type" )
View Source
var ( EnabledSyscalls = map[string]bool{} Unsupported = map[string]bool{ "brk": true, "": true, "execve": true, "access": true, "gettimeofday": true, "kill": true, "arch_prctl": true, "getcwd": true, "setdomainname": true, "reboot": true, "getppid": true, "umask": true, "adjtimex": true, "rt_sigprocmask": true, "rt_sigaction": true, "rt_sigtimedwait": true, "sysfs": true, "chdir": true, "clone": true, "newfstatat": true, "getsid": true, "getcpu": true, "sched_get_priority_min": true, "sched_get_priority_max": true, } VMACall = map[string]bool{ "mmap": true, "munmap": true, "mremap": true, "msync": true, "mprotect": true, "remap_file_pages": true, "shmat": true, "mlock": true, "munlock": true, "madvise": true, } Accept_labels = map[string]string{ "fd": "", "sock": "", "sock_alg": "$alg", "sock_in": "$inet", "sock_in6": "$inet6", "sock_netrom": "$netrom", "sock_nfc_llcp": "$nfc_llcp", "sock_sctp": "$sctp", "sock_unix": "$unix", "sock_netlink": "$inet6", } Bind_labels = map[string]string{ "fd": "", "sock": "", "sock_alg": "$alg", "sock_bt_hci": "$bt_hci", "sock_bt_l2cap": "$bt_l2cap", "sock_bt_rfcomm": "$bt_rfcomm", "sock_bt_sco": "$bt_sco", "sock_in": "$inet", "sock_in6": "$inet6", "sock_netlink": "$netlink", "sock_netrom": "$netrom", "sock_nfc_llcp": "$nfc_llcp", "sock_sctp": "$sctp", "sock_unix": "$unix", "AF_INET": "$inet", "AF_INET6": "$inet6", "sock_packet": "$packet", } Connect_labels = map[string]string{ "fd": "", "sock": "", "sock_bt_l2cap": "$bt_l2cap", "sock_bt_rfcomm": "$bt_rfcomm", "sock_bt_sco": "$bt_sco", "sock_in": "$inet", "sock_in6": "$inet6", "sock_netlink": "$netlink", "sock_netrom": "$netrom", "sock_nfc_llcp": "$nfc_llcp", "sock_nfc_raw": "$nfc_raw", "sock_sctp": "$sctp", "sock_unix": "$unix", "AF_INET": "$inet", "AF_INET6": "$inet6", } Bpf_labels = map[string]string{ "BPF_PROG_LOAD": "$PROG_LOAD", } Setsockopt_labels = map[Pair]string{}/* 158 elements not displayed */ Getsockopt_labels = map[Pair]string{}/* 155 elements not displayed */ Getsockname_labels = map[string]string{ "fd": "", "sock": "", "sock_in": "$inet", "sock_in6": "$inet6", "sock_netlink": "$netlink", "sock_netrom": "$netrom", "sock_sctp": "$sctp", "sock_unix": "$unix", } SocketLevel_map = map[string]string{ "SOL_SOCKET": "SOL_SOCKET", "SOL_IPV6": "IPPROTO_IPV6", "SOL_ICMPV6": "SOL_ICMPV6", "SOL_TCP": "IPPROTO_TCP", "SOL_RAW": "IPPROTO_ICMP", "SOL_PACKET": "SOL_PACKET", "SOL_IP": "IPPROTO_IP", "SOL_SCTP": "SOL_SCTP", } Sendto_labels = map[string]string{ "fd": "", "sock": "", "sock_in": "$inet", "sock_in6": "$inet6", "sock_sctp": "$sctp", "sock_unix": "$unix", "sock_netlink": "$inet6", } Sendmsg_labels = map[string]string{ "fd": "", "sock": "", "sock_in6": "", "sock_in": "", "sock_sctp": "$sctp", "sock_unix": "$unix", "sock_algconn": "$alg", "sock_kcm": "$kcm", "sock_netlink": "$netlink", "sock_netrom": "$netrom", "sock_nfc_llcp": "$nfc_llcp", } Recvfrom_labels = map[string]string{ "fd": "", "sock": "", "sock_in": "$inet", "sock_in6": "$inet6", "sock_sctp": "$sctp", "sock_unix": "$unix", "sock_netlink": "$inet6", "sock_packet": "$packet", } Ioctl_map = map[string]string{ "FIONBIO": "$int_in", "FIOASYNC": "$int_in", "FS_IOC_GETFLAGS": "$int_out", "FS_IOC_SETFLAGS": "$int_in", "SIOCGIFINDEX": "$sock_SIOCGIFINDEX", } Socket_labels_pair = map[Pair]string{ Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_DGRAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_STREAM"}: "$inet", Pair{"AF_INET", "SOCK_RAW"}: "$inet_icmp_raw", Pair{"AF_PACKET", "SOCK_RAW"}: "$packet", Pair{"AF_PACKET", "SOCK_DGRAM"}: "$packet", Pair{"AF_INET", "SOL_SCTP"}: "$inet_sctp", } Socket_labels = map[string]string{ "AF_INET": "$inet", "AF_INET6": "$inet6", "AF_KCM": "$kcm", "AF_UNIX": "$unix", "AF_NETLINK": "$netlink", "AF_PACKET": "$packet", } Fcntl_labels = map[string]string{ "F_DUPFD": "$dupfd", "F_DUPFD_CLOEXEC": "$dupfd", "F_GETFD": "$getflags", "F_GETFL": "$getflags", "F_GETSIG": "$getflags", "F_GETLEASE": "$getflags", "F_GETPIPE_SZ": "$getflags", "F_GET_SEALS": "$getflags", "F_SETFD": "$setflags", "F_SETFL": "$setstatus", "F_SETLK": "$lock", "F_SETLKW": "$lock", "F_GETLK": "$lock", "F_GETOWN": "$getown", "F_SETOWN": "$setown", "F_GETOWN_EX": "$getownex", "F_SETOWN_EX": "$setownex", "F_SETSIG": "$setsig", "F_SETLEASE": "$setlease", "DN_MULTISHOT": "$notify", "DN_ACCESS": "$notify", "DN_MODIFY": "$notify", "DN_CREATE": "$notify", "DN_DELETE": "$notify", "DN_RENAME": "$notify", "DN_ATTRIB": "$notify", "F_SETPIPE_SZ": "$setpipe", "F_ADD_SEALS": "$addseals", } Keyctl_labels = map[string]string{ "KEYCTL_GET_KEYRING_ID": "$get_keyring_id", "KEYCTL_JOIN_SESSION_KEYRING": "$join", "KEYCTL_UPDATE": "$update", "KEYCTL_REVOKE": "$revoke", "KEYCTL_DESCRIBE": "$describe", "KEYCTL_CLEAR": "$clear", "KEYCTL_LINK": "$link", "KEYCTL_UNLINK": "$unlink", "KEYCTL_SEARCH": "$search", "KEYCTL_READ": "$read", "KEYCTL_CHOWN": "$chown", "KEYCTL_SETPERM": "$setperm", "KEYCTL_INSTANTIATE": "$instantiate", "KEYCTL_NEGATE": "$negate", "KEYCTL_SET_REQKEY_KEYRING": "$set_reqkey_keyring", "KEYCTL_SET_TIMEOUT": "$set_timeout", "KEYCTL_ASSUME_AUTHORITY": "$assume_authority", "KEYCTL_GET_SECURITY": "$get_security", "KEYCTL_SESSION_TO_PARENT": "$session_to_parent", "KEYCTL_REJECT": "$reject", "KEYCTL_INSTANTIATE_IOV": "$instantiate_iov", "KEYCTL_INVALIDATE": "$invalidate", "KEYCTL_GET_PERSISTENT": "$get_persistent", } Prctl_labels = map[string]string{ "PR_GET_DUMPABLE": "$void", "PR_GET_KEEPCAPS": "$void", "PR_GET_NO_NEW_PRIVS": "$void", "PR_GET_SECCOMP": "$void", "PR_GET_SECUREBITS": "$void", "PR_GET_TIMERSLACK": "$void", "PR_GET_TIMING": "$void", "PR_TASK_PERF_EVENTS_DISABLE": "$void", "PR_TASK_PERF_EVENTS_ENABLE": "$void", "PR_MCE_KILL_GE": "$void", "PR_CAPBSET_READ": "$intptr", "PR_CAPBSET_DROP": "$intptr", "PR_SET_CHILD_SUBREAPER": "$intptr", "PR_SET_DUMPABLE": "$intptr", "PR_SET_FPEMU": "$intptr", "PR_SET_KEEPCAPS": "$intptr", "PR_SET_NO_NEW_PRIVS": "$intptr", "PR_SET_PDEATHSIG": "$intptr", "PR_SET_SECUREBITS": "$intptr", "PR_SET_TIMERSLACK": "$intptr", "PR_SET_TIMING": "$intptr", "PR_SET_TSC": "$intptr", "PR_SET_UNALIGN": "$intptr", "PR_MCE_KILL": "$intptr", "PR_GET_CHILD_SUBREAPER": "$getreaper", "PR_GET_ENDIAN": "$getreaper", "PR_GET_FPEMU": "$getreaper", "PR_GET_FPEXC": "$getreaper", "PR_GET_PDEATHSIG": "$getreaper", "PR_GET_TID_ADDRESS": "$getreaper", "PR_GET_TSC": "$getreaper", "PR_GET_UNALIGN": "$getreaper", "PR_SET_ENDIAN": "$setendian", "PR_SET_FPEXC": "$setfpexc", "PR_SET_NAME": "$setname", "PR_GET_NAME": "$getname", "PR_SET_PTRACER": "$setptracer", } Special_Consts = map[string]uint64{ "_LINUX_CAPABILITY_VERSION_1": uint64(0x19980330), "_LINUX_CAPABILITY_VERSION_2": uint64(0x20071026), "_LINUX_CAPABILITY_VERSION_3": uint64(0x20080522), "PROT_NONE": 0, "O_ASYNC": uint64(0x0040), "O_TMPFILE": uint64(0x022000000), "SIGUSR1": uint64(10), "SIGALRM": uint64(14), "SIGFPE": uint64(8), "SIG_0": uint64(0), "S_ISUID": uint64(0x0004000), "S_ISGID": uint64(0x0002000), "RLIM64_INFINITY": ^uint64(0), "CLOCK_REALTIME_ALARM": uint64(8), "CLOCK_BOOTTIME_ALARM": uint64(9), "PERF_ATTR_SIZE_VER5": uint64(112), "PERF_ATTR_SIZE_VER4": uint64(104), "PERF_ATTR_SIZE_VER3": uint64(96), "PERF_ATTR_SIZE_VER2": uint64(80), "PERF_ATTR_SIZE_VER1": uint64(72), "PERF_ATTR_SIZE_VER0": uint64(64), "PERF_COUNT_HW_CPU_CYCLES": uint64(0), "PERF_COUNT_HW_INSTRUCTIONS": uint64(1), "PERF_COUNT_HW_CACHE_REFERENCES": uint64(2), "PERF_COUNT_HW_CACHE_MISSES": uint64(3), "PERF_COUNT_HW_BRANCH_INSTRUCTIONS": uint64(4), "PERF_COUNT_HW_BRANCH_MISSES": uint64(5), "PERF_COUNT_HW_BUS_CYCLES": uint64(6), "PERF_COUNT_HW_STALLED_CYCLES_FRONTEND": uint64(7), "PERF_COUNT_HW_STALLED_CYCLES_BACKEND": uint64(8), "PERF_COUNT_HW_REF_CPU_CYCLES": uint64(9), "PERF_COUNT_SW_CPU_CLOCK": uint64(0), "PERF_COUNT_SW_TASK_CLOCK": uint64(1), "PERF_COUNT_SW_PAGE_FAULTS": uint64(2), "PERF_COUNT_SW_CONTEXT_SWITCHES": uint64(3), "PERF_COUNT_SW_CPU_MIGRATIONS": uint64(4), "PERF_COUNT_SW_PAGE_FAULTS_MIN": uint64(5), "PERF_COUNT_SW_PAGE_FAULTS_MAJ": uint64(6), "PERF_COUNT_SW_ALIGNMENT_FAULTS": uint64(7), "PERF_COUNT_SW_EMULATION_FAULTS": uint64(8), "FUTEX_WAIT_PRIVATE": uint64(128), "FUTEX_WAKE_PRIVATE": uint64(129), "FUTEX_WAIT_REQUEUE_PI_PRIVATE": uint64(139), "FUTEX_UNLOCK_PI_PRIVATE": uint64(135), "FUTEX_CMP_REQUEUE_PI_PRIVATE": uint64(140), "MCL_ONFAULT": uint64(32768), "CAP_CHOWN": uint64(0), "CAP_DAC_OVERRIDE": uint64(1), "CAP_DAC_READ_SEARCH": uint64(2), "CAP_FOWNER": uint64(3), "CAP_FSETID": uint64(4), "CAP_KILL": uint64(5), "CAP_SETGID": uint64(6), "CAP_SETUID": uint64(7), "CAP_SETPCAP": uint64(8), "CAP_LINUX_IMMUTABLE": uint64(9), "CAP_NET_BIND_SERVICE": uint64(10), "CAP_NET_BROADCAST": uint64(11), "CAP_NET_ADMIN": uint64(12), "CAP_NET_RAW": uint64(13), "CAP_IPC_LOCK": uint64(14), "CAP_IPC_OWNER": uint64(15), "CAP_SYS_MODULE": uint64(16), "CAP_SYS_RAWIO": uint64(17), "CAP_SYS_CHROOT": uint64(18), "CAP_SYS_PTRACE": uint64(19), "CAP_SYS_PACCT": uint64(20), "CAP_SYS_ADMIN": uint64(21), "CAP_SYS_BOOT": uint64(22), "CAP_SYS_NICE": uint64(23), "CAP_SYS_RESOURCE": uint64(24), "CAP_SYS_TIME": uint64(25), "CAP_SYS_TTY_CONFIG": uint64(26), "CAP_MKNOD": uint64(27), "CAP_LEASE": uint64(28), "CAP_AUDIT_WRITE": uint64(29), "CAP_AUDIT_CONTROL": uint64(30), "CAP_SETFCAP": uint64(31), "FALLOC_FL_COLLAPSE_RANGE": uint64(0x08), "FALLOC_FL_ZERO_RANGE": uint64(0x10), "FALLOC_FL_INSERT_RANGE": uint64(0x20), "FALLOC_FL_UNSHARE_RANGE": uint64(0x40), "MEMBARRIER_CMD_QUERY": uint64(0), "MEMBARRIER_CMD_GLOBAL": uint64(1 << 0), "MEMBARRIER_CMD_GLOBAL_EXPEDITED": uint64(1 << 1), "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED": uint64(1 << 2), "MEMBARRIER_CMD_PRIVATE_EXPEDITED": uint64(1 << 3), "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED": uint64(1 << 4), "MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE": uint64(1 << 5), "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE": uint64(1 << 6), "MEMBARRIER_CMD_SHARED": uint64(1 << 0), "SIGUSR2": 31, "R_OK": uint64(4), "W_OK": uint64(2), "X_OK": uint64(1), "F_OK": uint64(0), } )
Functions ¶
func GetSyzType ¶
func PointerArg ¶
Types ¶
type ArrayType ¶
func NewArrayType ¶
type BinarySet ¶
type BinarySet struct { Expr1 *Expression Expr2 *Expression }
func NewBinarySet ¶
func NewBinarySet(expr1 *Expression, expr2 *Expression) *BinarySet
type Binop ¶
type Binop struct { Operand1 *Expression Op Operation Operand2 *Expression }
func NewBinop ¶
func NewBinop(operand1 *Expression, op Operation, operand2 *Expression) (b *Binop)
type BufferType ¶
type BufferType struct {
Val string
}
func NewBufferType ¶
func NewBufferType(val string) (typ *BufferType)
func (*BufferType) Name ¶
func (b *BufferType) Name() string
func (*BufferType) String ¶
func (b *BufferType) String() string
type Call ¶
func NewCallType ¶
type DynamicType ¶
type DynamicType struct { BeforeCall *Expression AfterCall *Expression }
func NewDynamicType ¶
func NewDynamicType(before, after Type) *DynamicType
func (*DynamicType) Name ¶
func (d *DynamicType) Name() string
func (*DynamicType) String ¶
func (d *DynamicType) String() string
type Expression ¶
type Expression struct { BinOp *Binop Unop *Unop FlagType *FlagType IntType *IntType MacroType *Macro BinarySetType *BinarySet }
func NewExpression ¶
func NewExpression(typ Type) (exp *Expression)
func (*Expression) Name ¶
func (r *Expression) Name() string
func (*Expression) String ¶
func (r *Expression) String() string
type Macro ¶
func NewMacroType ¶
type Parenthetical ¶
type Parenthetical struct {
// contains filtered or unexported fields
}
func NewParenthetical ¶
func NewParenthetical() *Parenthetical
type PointerType ¶
func NewPointerType ¶
func NewPointerType(addr uint64, res Type) (typ *PointerType)
func NullPointer ¶
func NullPointer() (typ *PointerType)
func (*PointerType) IsNull ¶
func (typ *PointerType) IsNull() bool
func (*PointerType) Name ¶
func (p *PointerType) Name() string
func (*PointerType) String ¶
func (p *PointerType) String() string
type SocketDesc ¶
type StructType ¶
type StructType struct {
Fields []Type
}
func NewStructType ¶
func NewStructType(types []Type) (typ *StructType)
func (*StructType) Name ¶
func (s *StructType) Name() string
func (*StructType) String ¶
func (s *StructType) String() string
type Syscall ¶
type Syscall struct { CallName string Args []Type Pid int64 Ret int64 Cover []uint64 Paused bool Resumed bool }
func NewSyscall ¶
type TraceTree ¶
type TraceTree struct { TraceMap map[int64]*Trace Ptree map[int64][]int64 RootPid int64 Filename string }
func NewTraceTree ¶
func NewTraceTree() (tree *TraceTree)
type Unop ¶
type Unop struct { Operand *Expression Op Operation }
func NewUnop ¶
func NewUnop(operand *Expression, op Operation) (u *Unop)
Click to show internal directories.
Click to hide internal directories.