aboutsummaryrefslogtreecommitdiffstats
path: root/executor/syscalls_test.h
Commit message (Collapse)AuthorAgeFilesLines
* executor: overhaulDmitry Vyukov2018-07-241-241/+0
| | | | | | | | | | | | | | | | | Make as much code as possible shared between all OSes. In particular main is now common across all OSes. Make more code shared between executor and csource (in particular, loop function and threaded execution logic). Also make loop and threaded logic shared across all OSes. Make more posix/unix code shared across OSes (e.g. signal handling, pthread creation, etc). Plus other changes along similar lines. Also support test OS in executor (based on portable posix) and add 4 arches that cover all execution modes (fork server/no fork server, shmem/no shmem). This change paves way for testing of executor code and allows to preserve consistency across OSes and executor/csource.
* prog, pkg/compiler: support fmt typeDmitry Vyukov2018-07-081-4/+16
| | | | | fmt type allows to convert intergers and resources to string representation.
* pkg/compiler: check for unused declarationsDmitry Vyukov2018-06-301-4/+6
| | | | | Error on unused structs/unions/resources/flags. Finds tons of bugs.
* prog: detect when flags are a bitmaskDmitry Vyukov2018-06-301-2/+2
|
* executor: rework fallback coverageDmitry Vyukov2018-06-221-0/+4
| | | | | | | | | | We have fallback coverage implmentation for freebsd. 1. It's broken after some recent changes. 2. We need it for fuchsia, windows, akaros, linux too. 3. It's painful to work with C code. Move fallback coverage to ipc package, fix it and provide for all OSes.
* sys: mark output resources as optDmitry Vyukov2018-06-181-4/+8
| | | | | Mark output resources as opt in preparation for more precise constructor calculation.
* executor: make syscall table and number constantDmitry Vyukov2018-06-071-4/+4
| | | | | | | | | We see some crashes that suggest corruption of the syscall number: invalid command number 1296 (errno 11) invalid command number 107 (errno 110) Make the table and the number constant to prevent corruption.
* sys: dedup mmap code across OSesDmitry Vyukov2018-05-061-4/+4
| | | | Update #538
* sys: move generate files to separate packagesDmitry Vyukov2018-05-051-2/+2
| | | | | | | | | Move generated files to gen subdir. This allows to: 1. Rebuild init.go without rebuilding generated code. 2. Excluding generated files from gometalinter checking. This makes faster and consume less memory. Update #538
* gometalinter: enable package comment checkingDmitry Vyukov2018-05-031-2/+2
| | | | Update #538
* prog: harden program parsing against description changes moreDmitry Vyukov2018-03-051-4/+6
| | | | | | | Handle most of type changes, e.g. const is changed to struct, or struct to pointers. In all these cases we create default args. They may not give the coverage anymore, but still better than losing them right away.
* prog: handle excessive args and fields during program parsingDmitry Vyukov2018-03-051-4/+10
| | | | | Tolerate excessive args and fields during program parsing. This is useful after description changes to not lose corpus.
* pkg/compiler: allow specifying static size for filename'sDmitry Vyukov2018-03-051-4/+6
| | | | Sometimes filenames are embed into structs and need to take fixed space.
* pkg/compiler: support size attribute for unionsDmitry Vyukov2018-03-051-4/+6
|
* pkg/compiler: add size attribute for structsDmitry Vyukov2018-03-051-4/+6
| | | | The size attribute allows to pad a struct up to the specified size.
* prog: properly squash bitfieldsDmitry Vyukov2018-02-261-2/+2
|
* prog: add arbitrary mutation of complex structsDmitry Vyukov2018-02-251-4/+8
| | | | | | Squash complex structs into flat byte array and mutate this array with generic blob mutations. This allows to mutate what we currently consider as paddings and add/remove paddings from structs, etc.
* pkg/compiler: fix alignment corner caseDmitry Vyukov2018-02-251-4/+6
| | | | | Fix alignemnt calculation for packed structs with alignment and bitfields. Amusingly this affected only a single real struct -- ipv6_fragment_ext_header.
* pkg/compiler: don't assign call IDs staticallyDmitry Vyukov2018-02-251-2/+2
| | | | | | IDs change whenever a call is added or removed, this leads to large diffs unnecessarly. Assign IDs dynamically.
* pkg/compiler: allow unions as syscall argumentsDmitry Vyukov2018-02-231-4/+6
| | | | | If all union options can be syscall arguments, allow the union itself as syscall argument.
* pkg/compiler: fix corner case in alignment calculationDmitry Vyukov2018-02-191-4/+6
|
* prog: rework address allocationDmitry Vyukov2018-02-191-2/+8
| | | | | | | | | | | | 1. mmap all memory always, without explicit mmap calls in the program. This makes lots of things much easier and removes lots of code. Makes mmap not a special syscall and allows to fuzz without mmap enabled. 2. Change address assignment algorithm. Current algorithm allocates unmapped addresses too frequently and allows collisions between arguments of a single syscall. The new algorithm analyzes actual allocations in the program and places new arguments at unused locations.
* pkg/compiler: allow len of var-len arraysDmitry Vyukov2018-02-171-4/+6
| | | | | All netfilter subsystems use this unfortunately, so demote this to a warning.
* pkg/compiler: allow unions with only 1 fieldDmitry Vyukov2018-01-271-4/+6
| | | | | | | | | | | | | Unions with only 1 field are not actually unions, and can always be replaced with the option type. However, they are still useful when there will be more options in future but currently only 1 is described. Alternatives are: - not using union (but then all existing programs will be broken when union is finally introduced) - adding a fake field (ugly and reduces fuzzer efficiency) Allow unions with only 1 field.
* pkg/compiler, prog: fix template parent lensDmitry Vyukov2018-01-241-4/+6
| | | | | | | It's possible that a struct can have 2+ parents, which is the same template (differs only by arguments). See the new test case. Support such case.
* pkg/compiler: fix len of parent template structDmitry Vyukov2018-01-231-4/+6
| | | | | | | | | | | | | | | | | | | | | Consider the following example: type len_templ1[DATA1, DATA2] { data DATA1 inner len_temp2[DATA2] } type len_temp2[DATA] { data DATA len len[len_templ1, int8] } Here len refers to a parent struct, but the struct is a template, so it's actual name is something like "len_templ1[int8, int16]". Currently this does not work as compiler barks at incorrect len target. Make this work.
* sys/syz-sysgen: don't generate syz_ syscall numbersDmitry Vyukov2018-01-131-144/+140
| | | | They don't seem to be used today.
* pkg/compiler: support void typeDmitry Vyukov2018-01-131-2/+2
| | | | | | "void": type with static size 0 mostly useful inside of templates and varlen unions can't be syscall argument
* prog: support opt for proc typesDmitry Vyukov2018-01-061-4/+8
|
* prog: add test for len mutationDmitry Vyukov2018-01-061-4/+6
| | | | Test we actually can get an unnatural len value.
* pkg/compiler: add bitsize typeDmitry Vyukov2018-01-061-4/+8
| | | | This is need for few crypto/xfrm descriptions.
* prog: don't serialize output data argsDmitry Vyukov2017-12-171-6/+8
| | | | | | | | Fixes #188 We now will write just ""/1000 to denote a 1000-byte output buffer. Also we now don't store 1000-byte buffer in memory just to denote size. Old format is still parsed.
* prog: introduce more readable format for data argsDmitry Vyukov2017-12-171-4/+6
| | | | | | | | | | | | | | | | | | | | | Fixes #460 File names, crypto algorithm names, etc in programs are completely unreadable: bind$alg(r0, &(0x7f0000408000)={0x26, "6861736800000000000000000000", 0x0, 0x0, "6d6435000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000 00000000000"}, 0x58) Introduce another format for printable strings. New args are denoted by '' ("" for old args). New format is enabled for printable chars, \x00 and \t, \r, \n. Example: `serialize(&(0x7f0000408000)={"6861736800000000000000000000", "4849000000"})`, vs: `serialize(&(0x7f0000408000)={'hash\x00', 'HI\x00'})`,
* prog: fix TestMutateTableDmitry Vyukov2017-12-171-4/+18
| | | | | | Now works fast enough even for short mode. Fixes #208
* sys: move test syscalls to a separate targetDmitry Vyukov2017-12-171-0/+157
We have them in linux solely for historical reasons. Fixes #462