aboutsummaryrefslogtreecommitdiffstats
path: root/sys/test/32.go
Commit message (Collapse)AuthorAgeFilesLines
* sys: move generate files to separate packagesDmitry Vyukov2018-05-051-827/+0
| | | | | | | | | 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-1/+2
| | | | Update #538
* prog: harden program parsing against description changes moreDmitry Vyukov2018-03-051-1/+7
| | | | | | | 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-1/+11
| | | | | 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-1/+11
| | | | Sometimes filenames are embed into structs and need to take fixed space.
* pkg/compiler: support size attribute for unionsDmitry Vyukov2018-03-051-1/+8
|
* pkg/compiler: add size attribute for structsDmitry Vyukov2018-03-051-1/+9
| | | | The size attribute allows to pad a struct up to the specified size.
* prog: properly squash bitfieldsDmitry Vyukov2018-02-261-2/+12
|
* prog: add arbitrary mutation of complex structsDmitry Vyukov2018-02-251-1/+34
| | | | | | 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-1/+18
| | | | | 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-87/+87
| | | | | | 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-9/+21
| | | | | 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-41/+56
|
* prog: rework address allocationDmitry Vyukov2018-02-191-2/+2
| | | | | | | | | | | | 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-31/+35
| | | | | All netfilter subsystems use this unfortunately, so demote this to a warning.
* pkg/compiler: allow unions with only 1 fieldDmitry Vyukov2018-01-271-9/+15
| | | | | | | | | | | | | 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-31/+51
| | | | | | | 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-30/+43
| | | | | | | | | | | | | | | | | | | | | 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-70/+70
| | | | They don't seem to be used today.
* pkg/compiler: support void typeDmitry Vyukov2018-01-131-42/+42
| | | | | | "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-71/+77
|
* prog: add test for len mutationDmitry Vyukov2018-01-061-71/+75
| | | | Test we actually can get an unnatural len value.
* pkg/compiler: add bitsize typeDmitry Vyukov2018-01-061-49/+57
| | | | This is need for few crypto/xfrm descriptions.
* prog: don't serialize output data argsDmitry Vyukov2017-12-171-70/+74
| | | | | | | | 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-67/+74
| | | | | | | | | | | | | | | | | | | | | 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-67/+88
| | | | | | Now works fast enough even for short mode. Fixes #208
* sys: move test syscalls to a separate targetDmitry Vyukov2017-12-171-0/+605
We have them in linux solely for historical reasons. Fixes #462