aboutsummaryrefslogtreecommitdiffstats
path: root/sys/decl.go
Commit message (Collapse)AuthorAgeFilesLines
* prog, sys: move types to progDmitry Vyukov2017-09-051-522/+0
| | | | | | | | | | | Large overhaul moves syscalls and arg types from sys to prog. Sys package now depends on prog and contains only generated descriptions of syscalls. Introduce prog.Target type that encapsulates all targer properties, like syscall list, ptr/page size, etc. Also moves OS-dependent pieces like mmap call generation from prog to sys. Update #191
* sys: rename Call to SyscallDmitry Vyukov2017-09-051-20/+20
| | | | | In preparation for moving sys types to prog to avoid confusion between sys.Call and prog.Call.
* pkg/compiler: assign Call.ID staticallyDmitry Vyukov2017-09-041-2/+1
|
* sys: change BitfieldLast to BitfieldMiddleDmitry Vyukov2017-09-041-13/+5
| | | | | | | | That's the condition we always want. Currently we always check: t.BitfieldOffset() == 0 || t.BitfieldLast() now can check just: !t.BitfieldMiddle()
* sys: remove IntSignalnoDmitry Vyukov2017-09-041-3/+2
|
* sys, pkg/compiler: move padding computation to compilerDmitry Vyukov2017-09-041-209/+56
| | | | This makes types constant during execution, everything is precomputed.
* pkg/compiler: move bitfield marking from sysDmitry Vyukov2017-09-041-1/+1
|
* sys: don't assume vma size is 8Dmitry Vyukov2017-09-041-3/+2
| | | | | Use explicit size for vma. This is the last use of hardcoded ptrSize in sys package.
* sys: allow custom size for PtrTypeDmitry Vyukov2017-09-021-2/+3
| | | | This is required to support ptr64 type.
* pkg/compiler: check and generate typesDmitry Vyukov2017-09-021-65/+41
| | | | | | Move most of the logic from sysgen to pkg/compiler. Update #217
* sys: export struct/union attributesDmitry Vyukov2017-08-311-8/+8
| | | | | Export struct/union attributes so that they can be filled in by a different package.
* all: support i386 archDmitry Vyukov2017-08-191-13/+0
| | | | Update #191
* sys: support arm archDmitry Vyukov2017-08-191-0/+13
| | | | | | | Not tested, but const extraction and build works. Update #324 Update #191
* sys, prog: switch values to to uint64Dmitry Vyukov2017-08-191-50/+50
| | | | | | | | | | We currently use uintptr for all values. This won't work for 32-bit archs. Moreover in some cases we use uintptr but assume that it is always 64-bits (e.g. in encodingexec). Switch everything to uint64. Update #324
* csource: don't generate execute_syscall callsAndrey Konovalov2017-06-121-0/+1
|
* sys: remove debug leftoverDmitry Vyukov2017-05-301-1/+0
|
* sys: generate arrays instead of mapsDmitry Vyukov2017-05-291-9/+85
| | | | | | | | Compilation of large maps is super slow. Generate arrays instead and converet to maps at runtime. Reduces build time from ~40s to ~2s. Update #182
* all: speed up testsDmitry Vyukov2017-05-291-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark tests as parallel where makes sense. Speed up sys.TransitivelyEnabledCalls. Execution time is now: ok github.com/google/syzkaller/config 0.172s ok github.com/google/syzkaller/cover 0.060s ok github.com/google/syzkaller/csource 3.081s ok github.com/google/syzkaller/db 0.395s ok github.com/google/syzkaller/executor 0.060s ok github.com/google/syzkaller/fileutil 0.106s ok github.com/google/syzkaller/host 1.530s ok github.com/google/syzkaller/ifuzz 0.491s ok github.com/google/syzkaller/ipc 1.374s ok github.com/google/syzkaller/log 0.014s ok github.com/google/syzkaller/prog 2.604s ok github.com/google/syzkaller/report 0.045s ok github.com/google/syzkaller/symbolizer 0.062s ok github.com/google/syzkaller/sys 0.365s ok github.com/google/syzkaller/syz-dash 0.014s ok github.com/google/syzkaller/syz-hub/state 0.427s ok github.com/google/syzkaller/vm 0.052s However, main time is still taken by rebuilding sys package. Fixes #182
* prog, sys: add icmpv6 packet descriptions and checksumsAndrey Konovalov2017-02-081-3/+4
| | | | | | Also generalize checksums into the two kinds: inet and pseudo. Inet checksums is just the Internet checksum of a packet. Pseudo checksum is the Internet checksum of a packet with a pseudo header.
* prog, sys: add icmp descriptions and checksumAndrey Konovalov2017-02-061-1/+1
|
* prog, sys: add udp description and checksumAndrey Konovalov2017-02-021-0/+1
|
* prog, sys: add tcp packets descriptionsAndrey Konovalov2017-01-301-0/+1
| | | | Also embed tcp checksums into packets.
* all: implement edge coverageDmitry Vyukov2017-01-271-12/+2
| | | | | | | | | | | Currently syzkaller uses per-call basic block (BB) coverage. This change implements edge (not-per-call) coverage. Edge coverage is more detailed than BB coverage as it captures not-taken branches, looping, etc. So it provides better feedback signal. This coverage is now called "signal" throughout the code. BB code coverage is also collected as it is required for visualisation. Not doing per-call coverage reduces corpus ~6-7x (from ~35K to ~5K), this has profound effect on fuzzing efficiency.
* prog, sys: add csum type, embed checksums for ipv4 packetsAndrey Konovalov2017-01-251-1/+12
| | | | | | | This change adds a `csum[kind, type]` type. The only available kind right now is `ipv4`. Using `csum[ipv4, int16be]` in `ipv4_header` makes syzkaller calculate and embed correct checksums into ipv4 packets.
* prog: add FieldName to TypeAndrey Konovalov2017-01-231-0/+6
| | | | | FieldName() is the name of the struct field or union option with this type. TypeName() is now always the name of the type.
* prog, sys: fix padding varlen structsAndrey Konovalov2017-01-191-25/+79
|
* prog, sys: correctly calculate size of varlen structsAndrey Konovalov2017-01-181-0/+1
|
* prog: mutate sized strings with respect to sizeAndrey Konovalov2017-01-181-0/+1
|
* prog, sys: fix struct with bitfields size calculationAndrey Konovalov2017-01-181-1/+3
|
* prog: fix Size() for unions argsAndrey Konovalov2017-01-181-2/+2
|
* sys: packed structs have align of 1Andrey Konovalov2017-01-181-0/+3
|
* prog: add bitfields to templatesAndrey Konovalov2017-01-171-103/+97
| | | | | | Now it's possible to use `int32:18` to denote a bitfield of size 18 as a struct field. This fixes #72.
* sys, executor: more kvm improvementsDmitry Vyukov2017-01-121-0/+1
| | | | | | | 1. Basic support for arm64 kvm testing. 2. Fix compiler warnings in x86 kvm code. 3. Test all pseudo syz calls in csource. 4. Fix handling of real code in x86.
* sys: extend kvm supportDmitry Vyukov2017-01-091-2/+13
| | | | | | Add new pseudo syscall syz_kvm_setup_cpu that setups VCPU into interesting states for execution. KVM is too difficult to setup otherwise. Lots of improvements possible, but this is a starting point.
* sys: don't add clock_gettime alwaysDmitry Vyukov2017-01-091-4/+11
| | | | | | | | | | Currently we always enable clock_gettime in config. This is required since the call is needed for generation of timespec/timeval structs. The negative side effect is that one gets clock_gettime even if he wants to fuzz a small set of unrelated syscalls. Don't enable clock_gettime by default. Instead handle timeval/timespec as other resources.
* sys: allow to specify number of pages for vma typeDmitry Vyukov2017-01-091-0/+2
| | | | Allows to write vma[4] or vma[5-10] to specify desired number of pages.
* prog: add bytesizeN typesAndrey Konovalov2016-12-201-1/+1
|
* sys: move sockaddr description to templatesAndrey Konovalov2016-11-291-1/+0
|
* sys: move in_addr description to templatesAndrey Konovalov2016-11-291-1/+0
|
* sys: add proc type to denote per proccess integersAndrey Konovalov2016-11-251-2/+17
|
* sys: allow to specify buffer size for stringsDmitry Vyukov2016-11-111-8/+10
| | | | | | | | This allows to write: string[salg_type, 14] which will give a string buffer of size 14 regardless of actual string size. Convert salg_type/salg_name to this.
* sys: add string flagsDmitry Vyukov2016-11-111-21/+9
| | | | | | | | | | Allow to define string flags in txt descriptions. E.g.: filesystem = "ext2", "ext3", "ext4" and then use it in string type: ptr[in, string[filesystem]]
* sys: replace FileoffType with IntType{Kind: IntFileoff}Dmitry Vyukov2016-11-111-16/+2
| | | | | FileoffType is effectively an int, no need for a separate type. Also remove fd option from fileoff as it is unused and use story is unclear.
* sys: replace FilenameType with BufferType{Kind: BufferFilename}Dmitry Vyukov2016-11-111-13/+2
| | | | FilenameType is effectively a buffer, there is no need for a separate type.
* prog: remote Type argument from Arg.Size/ValueDmitry Vyukov2016-11-111-57/+0
| | | | | They are not necessary since we now always have types attached to args. Also remove sys.Type.InnerType as it is not necessary now as well.
* sys: attach Dir to all typesDmitry Vyukov2016-11-111-84/+69
| | | | | | Dir is a static info, so we don't need to compute, propagate and attach it in prog whenever we generate/change programs. Attach Dir to all types.
* sys: always use pointers to typesDmitry Vyukov2016-11-111-50/+50
| | | | | | | | Currently we store most types by value in sys.Type. This is somewhat counter-intuitive for C++ programmers, because one can't easily update the type object. Store pointers to type objects for all types. It also makes it easier to update types, e.g. adding paddings.
* sys: fix StrConstType size and alignmentDmitry Vyukov2016-10-181-2/+2
| | | | | | | | | | The current code is probably a leftover from times when StrConstType itself implied an indirection (it was a pointer to the string). Now strconst it is lowered to PtrType[StrConstType], so its size is len of the string and align is 1. It is not possible to test it now, as it is always used with indirection, so static size and align do not affect struct layout.
* Add big-endian intsAndrey Konovalov2016-10-131-10/+15
|
* Refactor & improve len type handlingAndrey Konovalov2016-10-111-0/+57
|