aboutsummaryrefslogtreecommitdiffstats
path: root/prog/test
Commit message (Collapse)AuthorAgeFilesLines
* sys/syz-sysgen: serialize descriptions as gob and embedDmitry Vyukov2025-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating Go files with descriptions serialize them as gob and compress with flate. This significantly reduces build time, go vet time, and solves scalability problems with some static analysis tools. Reference times (all after rm -rf ~/.cache/go-build) before: TIME="%e %P %M" time go install ./syz-manager 48.29 577% 4824820 TIME="%e %P %M" time go test -c ./prog 56.28 380% 6973292 After: TIME="%e %P %M" time go install ./syz-manager 22.81 865% 859788 TIME="%e %P %M" time go test -c ./prog 12.74 565% 267760 syz-manager size before/after: 194712597 -> 83418407 -57% even provided we now embed all descriptions instead of just a single arch. Deflate/decoding time for a single Linux arch is ~330ms. Fixes #5542
* tools/syz-execprog: support running unsafe programsDmitry Vyukov2024-11-261-1/+1
|
* prog: enable debug checking in all testsDmitry Vyukov2024-05-061-1/+0
|
* prog: don't require preallocated buffer for exec encodingDmitry Vyukov2024-04-161-3/+2
| | | | | | If we send exec encoding to the fuzzer, it's not necessary to serialize exec encoding into existing buffer (currnetly we serialize directly into shmem). So simplify code by serializing into a new slice.
* prog: profile what consumes space in exec encodingDmitry Vyukov2024-04-151-1/+1
| | | | | | | | Allow to profile how many bytes are consumed for what in the exec encoding. The profile shows there are not many opportunities left. 53% are consumed by data blobs. 13% for const args. 18% for non-arg things (syscall number, copyout index, props, etc).
* prog: auto-set proper conditional fields in Deserialize()Aleksandr Nogikh2024-03-131-0/+3
| | | | | | | | | Treat all default union arguments as transient and reevaluate them after the call was fully parsed. Before conditional field patching, we do need to have performed arg validation, which also reevaluates conditions. To break the cycle, make validation configurable.
* Revert "prog: auto-set proper conditional fields in Deserialize()"Aleksandr Nogikh2024-03-081-3/+0
| | | | This reverts commit 8e75c913b6f9b09cab2ad31fd7d66ea0d1703de8.
* prog: auto-set proper conditional fields in Deserialize()Aleksandr Nogikh2024-03-081-0/+3
| | | | | | | | | Treat all default union arguments as transient and reevaluate them after the call was fully parsed. Before conditional field patching, we do need to have performed arg validation, which also reevaluates conditions. To break the cycle, make validation configurable.
* pkg/mgrconfig, prog, syz-fuzzer: manager-configurable syscall mutationHrutvik Kanabar2022-09-221-1/+1
| | | | | | | | | | | | | | | | | | Allow manager configuration to specify that certain syscalls should not be mutated. This is expected to be useful when mutating certain syscalls is unlikely to produce interesting executions. For example, mutating a `syz_mount_image` call will likely produce a corrupt image. Some implementation details: - Add a `no_mutate_syscalls` manager config entry, with the same format as `enable_syscalls`. Ensure this is parsed and stored in the config as a set of syscall IDs. - Send this set to fuzzers when they connect to their managers via RPC. Ensure each fuzzer stores a copy of the set. - When mutating arguments of a syscall, check first whether it has been specified as non-mutatable. - For all mutations not managed by a `syz-manager`, retain previous behaviour by ensuring that no syscalls are considered non-mutable.
* prog: fix out-of-bounds access in any blob mutationDmitry Vyukov2022-06-201-0/+7
| | | | | | | | | | | | | | | | | If we grow any blob during mutation, we allocate a new address for it (so that it does not overlap with other data). To do this we call analyze after the mutation. However, after mutation the blob can grow out of bounds of the data area and analyze will cause out-of-bounds access during marking of existing allocations. Fix this by calling analyze before we mutate the blob. Also while we are here use the proper call for analyze. Currently we always analyze only the first call, which is wrong (probably a latent TODO from initial implementation). Fixes #3206
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-1/+2
| | | | | | | | | | | | We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
* prog: support disabled attributeDmitry Vyukov2020-05-041-3/+3
| | | | | Update #477 Update #502
* prog: fix out-of-bounds accessDmitry Vyukov2019-07-301-2/+4
| | | | | ParseLog can access data out-of-bounds. Fix that and fix regression fuzz tests to catch this.
* all: fix some static analysis warningsDmitry Vyukov2019-04-231-1/+1
| | | | | | Fix warnings produced by golangci-lint. Update #977
* prog/test: rename prog/fuzz to prog/testDmitry Vyukov2019-04-012-0/+104
gometalinter complained about fuzz.FuzzFoo names, but go-fuzz now requires all fuzz functions to start with Fuzz. So move the package to prog/test.