aboutsummaryrefslogtreecommitdiffstats
path: root/sys/fuchsia/gen
Commit message (Collapse)AuthorAgeFilesLines
* sys/syz-sysgen: serialize descriptions as gob and embedDmitry Vyukov2025-01-231-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sys: commit empty source filesDmitry Vyukov2021-04-211-0/+6
| | | | | | Commit empty files into generated packages, so that the tree is buildable even w/o generated files and Go tools continue to work.
* Makefile: generate descriptions on-the-flyDmitry Vyukov2020-04-303-20147/+0
| | | | | | | | | | | | | | | | | | Checking in the generated descriptions files makes few things simpler, but causes pain for pull requests: (1) PRs that touch descriptions _always_ conflict, (2) PRs are large and harder to review, (3) people sometimes forget to add auto-generated files. The proposed way does not require us to hardcode lots of dependencies in the Makefile (which is nice) and seem to work. Let's see how it works. The main contributor-visible consequence is that the auto-generated files do not need to be checked-in now. Credit for figuring the Makefile magic goes to @melver. Fixes #1291
* pkg/compiler: deduplicate Types in descriptionsDmitry Vyukov2020-04-262-9404/+14362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add prog.Ref Type that serves as a proxy for real types and allows to deduplicate Types in generated descriptions. The Ref type is effectively an index in an array of types. Just before serialization pkg/compiler replaces real types with the Ref types and prepares corresponding array of real types. When a Target is registered in prog package, we do the opposite operation and replace Ref's with the corresponding real types. This brings improvements across the board: compiler memory consumption is reduced by 15%, test building time by 25%, descriptions size by 33%. Before: $ du -h sys/linux/gen 54M sys/linux/gen $ time GOMAXPROCS=1 go test -p=1 -c ./prog real 0m54.200s real 0m53.883s $ time GOMAXPROCS=1 go install -p=1 ./tools/syz-execprog real 0m27.911s real 0m27.767s $ TIME="%e %P %M" GOMAXPROCS=1 time go tool compile ./sys/linux/gen 20.59 100% 3200016 20.97 100% 3445976 20.25 100% 3209684 After: $ du -h sys/linux/gen 36M sys/linux/gen $ time GOMAXPROCS=1 go test -p=1 -c ./prog real 0m42.290s real 0m43.230s $ time GOMAXPROCS=1 go install -p=1 ./tools/syz-execprog real 0m24.337s real 0m24.727s $ TIME="%e %P %M" GOMAXPROCS=1 time go tool compile ./sys/linux/gen 19.11 100% 2764952 19.66 100% 2787624 19.35 100% 2749376 Update #1580
* prog: add ignore_return and breaks_returns call attribtuesDmitry Vyukov2020-04-192-12/+12
| | | | | We had these hard-coded for fuchsia and linux accordingly. Replace with call attributes.
* pkg/compiler: check that const values fit into base typeDmitry Vyukov2020-03-172-662/+892
| | | | | const[0x12345678, int8] is always an error, detect these cases. Found some bugs in mptcp, socket proto and fuchsia fidl descriptions.
* pkg/compiler: calculate more precise sizes for argumentsDmitry Vyukov2020-03-172-6/+6
| | | | | | | | | | | | | | | | | | | | If we have: ioctl(fd fd, cmd int32) ioctl$FOO(fd fd, cmd const[FOO]) Currently we assume that cmd size in ioctl$FOO is sizeof(void*). However, we know that in ioctl it's specified as int32, so we can infer that the actual syscall size is 4. This massively reduces sizes of socket/setsockopt/getsockopt/ioctl and some other syscalls, which is good because we now use physical size in mutation/hints and some other places. This will also enable not morphing ioctl's into other ioctl's. Update #477 Update #502
* prog: remove unused ResourceDesc.TypeDmitry Vyukov2020-01-262-152/+152
|
* pkg/serializer: do not write field names if it won't save spaceDmitry Vyukov2020-01-262-5148/+5148
| | | | | | | If we are going to write all values, don't write field names. This only increases size of generated files. The change reduces size of generated files by 5.8% (62870496-59410354=3460142 bytes saved).
* pkg/compiler: don't mark flags with 0 as bitmaskDmitry Vyukov2020-01-182-30/+30
| | | | | | | They can't be a bitmask. This fixes important cases of "0, 1" and "0, 1, 2" flags. Fix some descriptions that added 0 to bitmasks explicitly (we should do it automatically instead).
* pkg/compiler: sort flags valuesDmitry Vyukov2020-01-182-40/+40
| | | | | | Will simplify runtime analysis of flags. Also just no reason to make it more deterministic and avoid unnecessary diffs in future if values are reordered.
* pkg/compiler: generate const[0] for flags w/o valuesDmitry Vyukov2020-01-182-6/+6
| | | | | | | Generate const[0] for flags without values and for flags with a single value which is 0. This is the intention in all existing cases (e.g. an enum with types of something, but there is really only 1 type exists).
* sys/fuchsia: remove deprecated exception APIsDavid Pursell2019-11-142-32/+8
| | | | | | The port-based exception APIs have been deprecated on Fuchsia and will be removed shortly. Delete them from the syscall definitions and modify the Fuchsia executor to use the new channel-based APIs instead.
* sys/fuchsia: fix Fuchsia extract/generateDavid Pursell2019-11-142-1326/+1510
| | | | | Updates some paths and add zx_eventpair type definition to fix `make extract` and `make generate`.
* pkg/compiler: define fileoff templatePaul Chaignon2019-11-012-14/+14
| | | | Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
* sys/fuchsia: update socket syscallsMarco Vanotti2019-08-142-814/+16
|
* sys/fuchsia: update zx_clock_get syscall (#1292)Marco Vanotti2019-07-162-10/+4
| | | | | | | | | | | | * sys/fuchsia: update zx_clock_get. zx_clock_get was deprecated and replaced by zx_clock_get_new. In a recent CL[0], they replaced the zx_clock_get by zx_clock_get_new and moved all client. This commit updates syzkaller to use the new function. [0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/298575 * run make extract && make generate
* run make extract and make generate for fuchsiaMarco Vanotti2019-07-162-406/+106
|
* sys/fuchsia: Updating Fuchsia definitionsPascal Perez2019-05-212-46/+508
| | | | | | Simply make extract TARGETOS=fuchsia SOURCEDIR=<FUCHSIA_DIR>/fuchsia
* .golangci.yml: add codeanalysis build tagDmitry Vyukov2019-05-152-2/+4
| | | | | | | | | Using a build tag to exclude files for golangci-lint reduces memory consumption (it does not parse them). The naive attempt with skip-dirs did not work. So add codeanalysis build tag and use it in auto-generated files. Update #977
* pkg/compiler: generate complex len targetsDmitry Vyukov2019-05-142-1468/+1468
| | | | Change the generated format for len type to support multiple path elements.
* Update syscalls (#1116)Marco Vanotti2019-04-222-66/+356
| | | | | | | | | * sys/fuchsia: update all syscalls. This commit modifies all the existing syscalls definitions to match more closely the documentation in the Fuchsia repo. * run make extract && make generate
* sys/fuchsia: Remove object_*_cookie syscalls. (#1099)Marco Vanotti2019-04-032-46/+80
| | | | | | | | Those syscalls were removed from Zircon in a recent CL[0]. This commit runs make extract && make generate to update syscalls and fidl interfaces. [0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/249349
* pkg/compiler: make buffer alias to ptr[array[int8]]Dmitry Vyukov2019-04-012-20/+20
| | | | | | | | | | | Ptr type has special handling of direction (pointers are always input). But buffer type missed this special case all the time. Make buffer less special by aliasing to the ptr[array[int8]] type. As the result buffer type can't have optional trailing "opt" attribute because we don't have such support for templates yet. Change such cases to use ptr type directly. Fixes #1097
* sys/sys-extract: update import path for fuchsia.Marco Vanotti2019-03-272-2/+10
| | | | | | | | | | Apparently, sysroot/include doesn't exist in the build-zircon path anymore. I changed the path in sys-extract to make it point to the exported sdk include path. I also ran make extract and make generate to add new fidl definitions. TEST=ran make extract and make generate.
* sys/fuchsia/fidlgen: update FIDL path & extract new descriptionsJulia Hansbrough2019-02-212-28/+16
| | | | | | | | Garnet-layer FIDL descriptions are in a new subdirectory. This CL changes it to the proper directory, and performed a "make extract" shortly after. This should fix some of the errors on the Syzkaller hub.
* sys/fuchsia: fix fidlgen issuesMarco Vanotti2019-02-062-2716/+3264
| | | | | | | | | | | | | | | | | | | | | | | | | * sys/fuchsia: fix fidlgen issues. This change modifies fidlgen removing fuchsia.mediacodec and renaming zircon-ethernet to fuchsia-hardware-ethernet. fuchsia.mediacodec has most of its functionality merged into fuchsia.media and it's not included in the default amd64 builds. zircon-ethernet has been renamed to fuchsia-hardware-ethernet recently: https://fuchsia-review.googlesource.com/c/zircon/+/237178 * docs/fuchsia: Add troubleshooting sections This commit adds a troubleshooting section in the fuchsia syzkaller docs that mentions how to solve fidlgen issues when fidl interfaces are removed or renamed. * sys/fuchsia: remove stale autogenerated files. * sys/fucsia run make extract && make generate.
* sys/fuchsia: fix task syscalls.Marco Vanotti2018-11-292-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes two issues related to the task syscalls. The zx_task_resume syscall has been recently removed from zircon[0]. It has been deprecated for some time already. This commit removes the syscall. The `ZX_EXCEPTION_PORT_UNBIND_QUIETLY` option for the syscall `zx_task_bind_exception_port` has been removed recently as well[1]. This commit removes that option from tasks.txt. To test this change, I followed the procedure for building syzkaller for fuchsia: ```shell $ make extract TARGETOS=fuchsia SOURCEDIR=${FUCHSIADIR} $ make generate $ make TARGETOS=fuchsia TARGETARCH=amd64 SOURCEDIR=${FUCHSIADIR} ``` I excluded the changes from make extract. This commit only has the generated files from make generate. [0]: https://fuchsia-review.googlesource.com/c/zircon/+/228712 [1]: https://fuchsia-review.googlesource.com/c/zircon/+/228658
* sys/fuchsia: update VMAR syscallsMarco Vanotti2018-11-212-8/+8
| | | | | | | | | | | | | | | | | | | | | | | * sys/fuchsia: update vmar syscalls. In a previous zircon commit[0], the vmar related syscalls (like `zx_vmar_map`, `zx_vmar_protect` and `zx_vmar_allocate`) changed the order of their parameters, making putting the flags parameter as the second parameter, and renaming it to "options". This commit modifies vmars.txt so that it reflects the latest state of the syscalls in zircon. I also modified the usage in `executor/common_fuchsia.h` I ran make extract, make generate and compiled syzkaller to test this change. [0]: https://fuchsia-review.googlesource.com/c/zircon/+/168060 * sys/fuchsia run make generate This commit is just the result of running make generate after its parent. This regenerates the definitions for the modified VMAR syscalls.
* sys/fuchsia: update fidl mappings.Marco Vanotti2018-11-212-72/+1064
| | | | | | | This commit is just a run of make extract + make generate with an up to date fuchsia tree. This commit only updates the fidl definitions, there are some other syscalls that had changed and need to be manually updated (that will come in a future commit).
* Update fidlgen to keep current with upstream.Julia Hansbrough2018-10-102-306/+1654
| | | | | The Syzkaller IR upstream has been updated, so we can properly update consts/fidl descriptions now.
* sys/fuchsia: add description for fuchsia.net, .net-stack, .ldsvc servicesDokyung Song2018-09-142-134/+2644
|
* sys/fuchsia: generate descriptions for garnet servicesDokyung Song2018-09-122-1008/+2360
|
* sys/fuchsia: regerenate filesDmitry Vyukov2018-09-112-258/+38
| | | | Regerenate files after the previous commit.
* sys/fuchsia: prune unused structs in syscall description generated by fidlgenDokyung Song2018-09-112-16/+2628
| | | | | | | | After generating syscall description for fidl files using fidlgen, prune all unused structs using the exact same mechanism used by the compiler's check for unused structs. This allows the FIDL compiler to support modular compilation; it does not need to have global knowledge of whether each struct is used or not.
* sys/linux: add syz_execute_funcDmitry Vyukov2018-08-302-10/+16
| | | | | | The function executes random code. Update #310
* sys/fuchsia: describe method response types & handles; add support for unionDokyung Song2018-08-292-976/+906
| | | | | | | | * create a response handle structure for each FIDL method * generate zx_channel_write for requests having no response * generate zx_channel_read for events (no request but just response) * translate FIDL union types to syzkaller union types (see fuchsia_io_ObjectInfoHandles)
* sys/fuchsia: description for fuchsia.io FIDL interfacesDokyung Song2018-08-272-44/+3022
|
* sys/fuchsia: Remove read_status from zx_channel_call args, and reflect ↵Dokyung Song2018-08-242-18/+4
| | | | zx_time_t type change (unsigned -> signed)
* sys/fuchsia: semi-automatically generated FIDL launcher descriptionDokyung Song2018-08-172-4/+432
|
* sys/fuchsia: add syscall description for binding channels to LauncherDokyung Song2018-08-082-2/+42
|
* sys/fuchsia: zx_log_* got replaced by zx_debuglog_*Dokyung Song2018-08-032-36/+2
|
* Makefile: don't compile all targets into target binariesDmitry Vyukov2018-08-023-4/+15
| | | | | | | | | | Currently target binaries contain support for all OS/arch combinations. However, obviously a fuchsia target binary won't test windows. For target binaries we need support only for a single target (with the exception of 386/arm target in amd64/arm64 binaries). So compile in only _the_ target into target binaries. This reduces akaros/amd64 fuzzer binary from 33 to 7 MB and execprog from 28 to 2 MB.
* sys/fuchsia: Update Fuchsia syscalls.Julia Hansbrough2018-07-072-18/+190
| | | | | | | | | Updates cover * zx_vmo_create * zx_clock_get_monotonic * hypervisor- and vCPU-related syscalls * system_get_features * some DDK syscalls
* sys/fuchsia: remove ZX_POL_NEW_EVPAIRDmitry Vyukov2018-06-302-6/+4
| | | | It was removed from zircon.
* prog: detect when flags are a bitmaskDmitry Vyukov2018-06-302-74/+74
|
* sys/fuchsia: add few new syscallsDmitry Vyukov2018-06-292-2/+56
|
* sys/fuchsia: add pipe syscallDmitry Vyukov2018-06-292-2/+16
|
* sys/fuchsia: remove zx_job_set_relative_importanceDmitry Vyukov2018-06-262-12/+2
| | | | It seems to be removed from zircon.
* sys: mark output resources as optDmitry Vyukov2018-06-182-4/+4
| | | | | Mark output resources as opt in preparation for more precise constructor calculation.