aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract/extract.go
Commit message (Collapse)AuthorAgeFilesLines
* all: use any instead of interface{}Dmitry Vyukov2025-12-221-2/+2
| | | | Any is the preferred over interface{} now in Go.
* tools/syz-declextract: allow to run on subset of archesDmitry Vyukov2025-04-031-14/+5
| | | | | | | This may be useful for downstream kernels that only build and are supposed to be used with a subset of arches. Some esoteric arches may be broken on such kernels. Allow to ignore them.
* tools/syz-linter: check tool.Failf messagesDmitry Vyukov2024-08-071-2/+2
| | | | Check tool.Failf messages for the common style as well.
* sys/syz-extract: add -config option to specify base kernel configJoey Jiao2024-05-231-0/+3
| | | | Change-Id: Iffb23c0789bb7cff341b68274a8a2efcbdd7598d
* all: remove akaros supportDmitry Vyukov2024-04-151-1/+0
| | | | | | | Akaros support is unused, it was shutdown on syzbot for a while, the akaros development seems to be frozen for years as well. We have a bunch of hacks for Akaros since it supported only super old gcc and haven't supported Go. Remove it.
* all: use special placeholder for errorsTaras Madan2023-07-241-1/+1
|
* sys/syz-extract: fix meta checking when using explicit file listDmitry Vyukov2023-05-021-7/+14
| | | | | | | | If syz-extract is executed with explicit file list and some of these files have meta tags that exclude them from processing for an arch, currently it leads to "const info for input file is missing" error. Check meta tags even for explicit file list.
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-2/+1
|
* sys/syz-extract: fix a deadlockDmitry Vyukov2022-06-151-8/+10
| | | | | | | | | | The jobs channel needs to have capacity to hold all files from all arches since they may all be queued to the channel at the same time. The bug was introduced in 44a5ca633e ("pkg/ast, pkg/compiler: support per-file metadata"). Restore full channel capacity. Fixes #3197
* pkg/ast, pkg/compiler: support per-file metadataDmitry Vyukov2022-04-291-67/+42
| | | | | | | | | | | | | | | | | | | | | We have a bunch of hacks in syz-extract, syz-sysgen and syz-check with respect to description files unsupported on some arches, or that must not be part of make extract. Add 2 meta attribtues to files: meta noextract Tells `make extract` to not extract constants for this file. Though, `syz-extract` can still be invoked manually on this file. meta arches["arch1", "arch2"] Restricts this file only to the given set of architectures. `make extract` and ``make generate` will not use it on other architectures. Later we can potentially use meta attributes to specify git tree/commit that must be used for extraction. Maybe something else. Fixes #2754
* sys/linux: update watch queue descriptionsDmitry Vyukov2022-03-161-2/+0
| | | | | | | The interface has significantly changed since the first version. Update to the upstreammed interface. Fixes #3030
* sys/linux: remove /dev/ion descriptionsDmitry Vyukov2022-01-111-3/+0
| | | | | | | The comment says: // ION support was removed from kernel. // We plan to leave the descriptions for some time as is and later remove them.
* sys/syz-extract: move SOURCEDIR check to callerPatrick Meyer2021-05-201-0/+4
|
* sys/syz-extract: initial darwin supportPatrick Meyer2021-05-201-0/+1
|
* sys/linux: update constsDmitry Vyukov2021-03-021-0/+2
| | | | | Update consts on upstream 7a7fd0de4a9804299793e564a555a49c1fc924cb. Remove termiox ioctls, they were removed in commit e0efb3168d34.
* sys/linux: update constsDmitry Vyukov2021-02-121-0/+3
| | | | Update consts on upstream 825b5991a46ef28a05a4646c8fe1ae5cef7c7828.
* sys/linux: add description for Mali Bifrost driver (#2394)Peter Shih2021-02-021-0/+3
| | | | | | | | | * sys/linux: add description for mali bifrost driver * sys/linux: regenerate dev_bifrost.txt.const * sys/linux/dev_bifrost: separate BASE_*_GROUP_ID_* to individual bits * sys/linux/dev_bifrost: format code
* all: use tool.Failf instead of local functionsDmitry Vyukov2020-12-251-10/+7
|
* sys/linux: remove FUTEX_WAIT_MULTIPLE operationAndré Almeida2020-12-111-2/+0
| | | | | | | | FUTEX_WAIT_MULTIPLE was added before it was merged, and nowadays we have other plans for futex. Remove all WAIT_MULTIPLE references so futex fuzzing can be re-enabled. Signed-off-by: André Almeida <andrealmeid@collabora.com>
* sys/linux: add incremental-fsDmitry Vyukov2020-12-101-0/+3
|
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-12/+12
| | | | | | | | | | | | 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.
* pkg/compiler: merge const files into a single fileDmitry Vyukov2020-08-131-30/+38
| | | | | | | | | | | | | | | | | | | | We now have 8 arches for Linux and .const files produce lots of noise in PRs and lots of diffs. If 3 .txt files are touched, the PR will have 24 .const files, which will be intermixed with .txt files. Frequently const values are equal across arches, and even if they don't spreading a single value across 8 files is inconvinient. Merge all 8 *_arch.const files into a single .const file. See the test for details of the new format. The old format is still parsed for now, we can't update all OSes at once. For Linux this reduces number of const files/lines from 1288/96599 to 158/11603. Fixes #1983
* sys/linux: rename watch_queue.txt to dev_watch_queue.txtAndrey Konovalov2020-06-121-1/+1
|
* sys/linux: rename mptcp.txt to vnet_mptcp.txtAndrey Konovalov2020-06-121-1/+1
|
* sys/syz-extract: fix for full pathsDmitry Vyukov2020-05-201-2/+2
| | | | | pkg/ast now uses full paths since 554f8f39c57d91c1be8724cf4054424c9fb5f151. Fix syz-extract accordingly.
* sys/syz-extract: don't warn about unsupported consts for 1 archDmitry Vyukov2020-05-111-1/+1
| | | | Only warn about unsupported consts when generating consts for all arches.
* sys/syz-extract: run mrproper for all linux archesDmitry Vyukov2020-05-091-5/+5
| | | | | | We only run for the current arch, but it's not enough to clean a build for another arch. Run mrproper for all non-clean arches.
* sys/syz-extract: fix output formattingDmitry Vyukov2020-02-211-1/+1
| | | | | | | Remove spaces in the beginning of the message. The message is actually multi-line and the spaces are added only before the first line, which makes the subsequent lines inconsistently offsetted.
* sys/linux: don't extract from futex.txt and watch_queue.txtDmitry Vyukov2020-02-181-0/+5
| | | | These are not present in linux-next.
* sys/syz-extract: print less outputDmitry Vyukov2019-12-181-3/+1
| | | | | | Don't print every file if extraction is successful. This makes seeing errors harder as output for each arch takes more than a single screen.
* sys/syz-extract: extract constants from ELFDmitry Vyukov2019-12-021-4/+0
| | | | | | | | | | | | | Add a second mode that extracts constant values from ELF object, instead of running the executable. This allows to not (1) link binaries, (2) use proper cross-compiler. It finally fixes 386/arm extracts for my distro. Hopefully not makes things worse for others, should generally be safer/more reliable. The current mode is left b/c I can't test all OSes, windows binaries are not ELF, so we may need it anyway. But later we may switch more OSes to this new mode if they break (fuchsia?).
* sys/syz-extract: use clang if gcc is brokenDmitry Vyukov2019-12-011-0/+4
| | | | | | | On my Debian gcc -m32 is hopelessly broken. Using clang fixes at least arch 386. Arch arm is still broken b/c clang does not like some of kernel arm inline assemly constraints.
* sys/syz-extract: re-enable extraction for fsverity.txtEric Biggers2019-09-191-4/+0
| | | | fsverity is now upstream, so re-enable extracting its consts.
* sys/linux: regenerate and fix const filesDmitry Vyukov2019-03-141-1/+5
| | | | | | | | 1. Move fsverity descriptions to a separate file which is not regenerated automatically. It was dropped from linux-next. 2. Fix tlk_device.txt name in syz-extract. 3. Update some socket consts e.g. s/SO_TIMESTAMPING/SO_TIMESTAMPING_OLD/. 4. Regenerate const files on current upstream head.
* sys/linux: regenerate constsDmitry Vyukov2019-02-121-1/+1
| | | | Regenereate consts on latest linux-next.
* sys/linux: fix up mptcp descriptionsDmitry Vyukov2019-01-251-3/+6
| | | | | | | 1. Generate .const files for all arches. 2. Don't extract mptcp consts on android. 3. Remove mptcp includes from vnet.txt. 4. Enable CONFIG_MPTCP in syz-extract (mptcp is not like all other kernel headers).
* sys/linux: add Multipath TCP description8litz2019-01-251-0/+1
| | | https://tools.ietf.org/html/rfc6824
* sys/syz-extract: add -includedirs optionJoey Jiao2019-01-191-12/+15
| | | | | | Kernel modules are in different directories in some cases, so to include the headers in the module dir or other directories the includedirs flag is added. ex: -includedirs path1/include,path2/include
* sys: initial trusty supportDmitry Vyukov2018-11-071-0/+1
| | | | | | | | | Trusty is a set of software components supporting a Trusted Execution Environment (TEE) on mobile devices. https://source.android.com/security/trusty Add syscall descriptions and some boilerplate.
* Add mandatory OpenBSD bits (#689)Anton Lindqvist2018-08-281-0/+1
| | | | | | | | | | | | | | | | | | all: add openbsd support squash of the following commits: * openbsd: add mandatory bits * report: add OpenBSD support * executor: skip building kvm on OpenBSD * executor: add OpenBSD support Linking against libutil is necessary due to usage of openpty(3). * executor: fix typo in fail() message * fixup! report: add OpenBSD support * fixup! openbsd: add mandatory bits * fixup! openbsd: add mandatory bits * fixup! openbsd: add mandatory bits * fixup! report: add OpenBSD support * gometalinter: skip sys/openbsd
* sys/syz-extract: refactor mainDmitry Vyukov2018-08-021-60/+74
| | | | | | main is too long and complex. Move more logic into helper functions. Update #538
* gometalinter: clean up vetshadowDmitry Vyukov2018-07-311-11/+11
| | | | | | | This just cleans up existing warnings. vetshadow is not enabled yet because it crashes. Update #538
* Makefile, sys/targets: move all native compilation logic to sys/targetsDmitry Vyukov2018-06-061-1/+1
| | | | | | | | | | | | | | | We currently have native cross-compilation logic duplicated in Makefile and in sys/targets. Some pieces are missed in one place, some are in another. Only pkg/csource knows how to check for -static support. Move all CC/CFLAGS logic to sys/targets and pull results in Makefile. This should make Makefile work on distros that have broken x86_64-linux-gnu-gcc, now we will use just gcc. And this removes the need to define NOSTATIC, as it's always auto-detected. This also paves the way for making pkg/csource work on OSes other than Linux.
* sys/linux: regenerate video4linux consts on the right treeDmitry Vyukov2018-05-111-5/+3
| | | | | Now generated on: https://source.codeaurora.org/quic/la/kernel/msm-4.9 msm-4.9
* sys/linux: add missing consts for video4linux.txtDmitry Vyukov2018-05-111-0/+5
| | | | | | | | | | | | | For now other arches are regenerated on upstream tree. It does not contain a bunch of consts, so we define them to 1 for now. arm64 consts are left intact. video4linux.txt is added to "android" files in syz-extract, so that future make extract runs don't overwrite arm64 consts. Also fix VIDIOC_G_FBUF argument direction, currently tests crash with: panic: call ioctl$VIDIOC_G_FBUF: pointer arg 'buffer' has output direction [recovered] panic: call ioctl$VIDIOC_G_FBUF: pointer arg 'buffer' has output direction
* sys/syz-extract: split overly long functionDmitry Vyukov2018-05-071-40/+47
| | | | Update #538
* sys/syz-extract: provide readable error on missing input fileDmitry Vyukov2018-04-191-0/+3
| | | | | | Currently syz-extract crashes with nil deref panic if it is executed manually and is gives an absent file name. Output a readable error.
* sys/syz-extract: save unsupported consts to the const filesDmitry Vyukov2018-02-011-28/+54
| | | | | | | | | | | We currently print unsupported consts to console during make extract. But this is not very useful as there are too many output now. This also does not allow to understand what's unsupported in newly checked-in descriptions, or what's unsupported in all current decriptions. Save unsupported consts to the const files instead. This solves all of the above problems.
* pkg/compiler: support type templatesDmitry Vyukov2018-01-131-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Netlink descriptions contain tons of code duplication, and need much more for proper descriptions. Introduce type templates to simplify writing such descriptions and remove code duplication. Note: type templates are experimental, have poor error handling and are subject to change. Type templates can be declared as follows: ``` type buffer[DIR] ptr[DIR, array[int8]] type fileoff[BASE] BASE type nlattr[TYPE, PAYLOAD] { nla_len len[parent, int16] nla_type const[TYPE, int16] payload PAYLOAD } [align_4] ``` and later used as follows: ``` syscall(a buffer[in], b fileoff[int64], c ptr[in, nlattr[FOO, int32]]) ```
* sys/linux: add ion and ashmem devices supportDmitry Vyukov2018-01-091-1/+0
| | | | | Note: ion supercedes the old android interface, which is moved to sys/android.