aboutsummaryrefslogtreecommitdiffstats
path: root/sys/netbsd/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-302-2526/+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-261-941/+1522
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sys/netbsd: add lchmod(2) (#1687)Ayushi Sharma2020-04-211-1/+6
|
* sys/netbsd: add minherit(2)ais2397@gmail.com2020-04-161-1/+11
|
* sys/netbsd: fix struct statais2397@gmail.com2020-04-131-16/+24
|
* sys/netbsd: adding chflags(2) syscalls (#1661)Ayushi Sharma2020-04-041-1/+23
|
* sys/netbsd: adding lwp syscalls (#1654)Ayushi Sharma2020-03-311-1/+13
|
* pkg/compiler: calculate more precise sizes for argumentsDmitry Vyukov2020-03-171-34/+34
| | | | | | | | | | | | | | | | | | | | 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-261-17/+17
|
* pkg/serializer: do not write field names if it won't save spaceDmitry Vyukov2020-01-261-751/+751
| | | | | | | 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-181-19/+19
| | | | | | | 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-181-62/+62
| | | | | | 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.
* sys/netbsd: fix the build issues with posix_spawnSiddharth Muralee2019-12-051-9/+23
|
* sys/netbsd: add the newer vfork syscallR3x2019-12-051-1/+3
|
* sys/netbsd: Added posix_spawn and fork syscallsR3x2019-12-051-1/+57
|
* pkg/compiler: define fileoff templatePaul Chaignon2019-11-011-7/+7
| | | | Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
* executor: add network packet injection for NetBSDSiddharth M2019-07-141-1/+20
| | | | | | | | | | | | * Initial Commit * working build of network packet fuzzing * Add missed csource file * pkg/csource: fix build * executor/common_bsd.h: Add comment stating reason for ifconfig create
* sys/netbsd: Adding more syscallsSiddharth M2019-07-011-1/+140
| | | | | | | | | | | | | | * sys/netbsd: Adding more syscalls * Added lwp create structures * Added a few lwp flags * completed _lwp* syscalls * add clone syscall * fix errors, recheck arguments
* sys/netbsd: Add new syscalls exit and ptraceR3x2019-06-261-1/+12
|
* .golangci.yml: add codeanalysis build tagDmitry Vyukov2019-05-151-1/+2
| | | | | | | | | 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-141-93/+93
| | | | Change the generated format for len type to support multiple path elements.
* pkg/compiler: make buffer alias to ptr[array[int8]]Dmitry Vyukov2019-04-011-30/+30
| | | | | | | | | | | 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
* pkg/csource: use 0 for missing syscall argsDmitry Vyukov2018-12-271-8/+8
| | | | | | | | | | | | | | We don't specify trailing unused args for some syscalls (e.g. ioctl that does not use its arg). Executor always filled tailing unsed args with 0's but pkg/csource didn't. Some such syscalls actually check that the unsed arg is 0 and as the result failed with C repro. We could statically check and eliminate all such cases, but it turns out the warning fires in 1500+ cases: https://gist.githubusercontent.com/dvyukov/e59ba1d9a211ee32fa0ba94fab86a943/raw/a3ace5a63f7281f0298f51ea9842ead1e4713418/gistfile1.txt So instead fill such args with 0's in pkg/csource too.
* sys: consistently mark all paddings as const[0]Dmitry Vyukov2018-12-101-3/+3
|
* sys/netbsd: fix socketpair usageMichael Tuexen2018-12-091-2/+6
|
* sys/netbsd: improve recvmsg() descriptionMichael Tuexen2018-12-081-9/+9
|
* sys: remove socketpair for AF_INET and AF_INET6Michael Tüxen2018-12-041-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * OpebBSD: remove socketpair() for AF_INET and AF_INET6. socketpair() is only supported on AF_UNIX. * NetBSD: remove socketpair() for AF_INET and AF_INET6. socketpair() is only supported for AF_UNIX. * FreeBSD: remove socketpair() for AF_INET and AF_INET6. socketpair() only supports AF_UNIX. * Linux: remove socketpair for AF_INET and AF_INET6. socketpair only supports AF_UNIX. * Autogenerated files. These are manually generated for all platforms you are not running on. FreeBSD in this case. * executor: rebase. * sys/freebsd: rebase. * sys/linux: use AF_UNIX based socketpair for nbd. This was suggested by Dmitry. Fixes #845
* sys: check that target consts are definedDmitry Vyukov2018-10-191-26/+2
| | | | | | | | | | | | | | Currently when we get target consts with target.ConstMap["name"] during target initialization, we just get 0 for missing consts. This is error-prone as we can mis-type a const, or a const may be undefined only on some archs (as we have common unix code shared between several OSes). Check that all the consts are actually defined. The check detects several violations, to fix them: 1. move mremap to linux as it's only defined on linux 2. move S_IFMT to openbsd, as it's only defined and used on openbsd 3. define missing MAP_ANONYMOUS for freebsd and netbsd 4. fix extract for netbsd
* sys/linux: add syz_execute_funcDmitry Vyukov2018-08-301-1/+4
| | | | | | The function executes random code. Update #310
* Makefile: don't compile all targets into target binariesDmitry Vyukov2018-08-022-2/+9
| | | | | | | | | | 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.
* prog, pkg/compiler: support fmt typeDmitry Vyukov2018-07-081-5/+5
| | | | | fmt type allows to convert intergers and resources to string representation.
* prog: detect when flags are a bitmaskDmitry Vyukov2018-06-301-65/+65
|
* sys: mark output resources as optDmitry Vyukov2018-06-181-2/+2
| | | | | Mark output resources as opt in preparation for more precise constructor calculation.
* sys: move generate files to separate packagesDmitry Vyukov2018-05-051-0/+1676
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