aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract
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.
* sys/syz-extract: add required compiler flagsPimyn Girgis2025-12-031-0/+4
| | | | | Add compiler flags to syz-extract to handle wide character constants and suppress implicit function declaration warnings in kernel headers.
* 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-declextract: support function scopesDmitry Vyukov2025-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract info about function scopes formed by switch'es on function arguments. For example if we have: void foo(..., int cmd, ...) { ... switch (cmd) { case FOO: ... block 1 ... case BAR: ... block 2 ... } ... } We record that any data flow within block 1 is only relevant when foo's arg cmd has value FOO, similarly for block 2 and BAR. This allows to do 3 things: 1. Locate ioctl commands that are switched on within transitively called functions. 2. Infer return value for each ioctl command. 3. Infer argument type when it's not specified in _IO macro. This will also allow to infer other multiplexed syscalls. Descriptions generated on Linux commit c4b9570cfb63501.
* sys/syz-extract: support kvm on armDmitry Vyukov2024-11-261-0/+6
| | | | | | | Add few more hacks to support few more cases. In particular including kvm headers for arm. It will be harder to avoid all these with auto-generated descriptions that pull in lots of random headers.
* all: remove some nolint: goconstTaras Madan2024-09-091-1/+0
|
* pkg/build: introduce the build jobs parameterAleksandr Nogikh2024-08-221-1/+1
| | | | | This parameter defines the number of cores dedicated to the kernel build process. By default, it's equal to the number of available CPUs.
* 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: use CopyFile instead of cp cmdJoey Jiao2024-05-311-2/+2
|
* sys/syz-extract: add -config option to specify base kernel configJoey Jiao2024-05-232-5/+15
| | | | Change-Id: Iffb23c0789bb7cff341b68274a8a2efcbdd7598d
* sys/syz-extract/freebsd.go: add compiler flag DCOMPAT_FREEBSD14 for ↵Oliver Sieber2024-04-221-0/+1
| | | | backwards compatibility
* all: remove akaros supportDmitry Vyukov2024-04-152-46/+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.
* sys/syz-extract/linux.go: remove one dup and ignore othersTaras Madan2023-10-301-1/+1
| | | | It contributes to #4285 unblocking.
* sys/syz-extract: fix a C code generation bugAleksandr Nogikh2023-10-091-5/+7
| | | | | | | Instead of an array of identifiers, we've been constructing an array of identifier + ast.Pos. Reported-by: Damiano Melotti<damianomelotti97@gmail.com>
* sys: refactor const extractionAleksandr Nogikh2023-10-043-21/+21
| | | | | 1) Make FabricateSyscallConsts() operate on ConstFile. 2) Expose Pos inside ConstInfo.
* sys/syz-extract: make FreeBSD 13 compat visableAndrew Turner2023-08-311-0/+1
| | | | | OGIO_KEYMAP and OPIO_KEYMAP are hidden behind COMPAT_FREEBSD13. Define it to make these visible.
* all: use special placeholder for errorsTaras Madan2023-07-246-14/+14
|
* 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.
* sys/syz-extract: extract FreeBSD syscalls from elfAndrew Turner2023-03-011-3/+4
| | | | | We may not be able to build an executable for all architectures. Switch to extracting the needed information from an elf object file.
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-232-4/+3
|
* sys/syz-extract: fix const generation on freebsd/riscv64P1umer2023-01-031-0/+5
|
* all: add support for custom linkerAleksandr Nogikh2022-10-121-1/+1
| | | | | Add this as an option to syz-ci and syz-build tools. Otherwise we cannot use clang + ld.lld for kernel builds.
* 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-292-76/+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: disable DEBUG_INFO_BTFDmitry Vyukov2022-01-111-0/+2
| | | | | | | syz-env make extract fails on upstream commit d1587f7bfe: /usr/bin/env: 'python3': No such file or directory make[3]: *** [Makefile:72: bpf/resolve_btfids] Error 2
* sys/syz-extract: fix linux extractDmitry Vyukov2022-01-111-0/+1
| | | | | | Currently fails with: <stdin>:7:10: fatal error: asm/msr.h: No such file or directory
* sys/linux: add /dev/cpu/X/msr to dev_msr.txtVikram Narayanan2021-11-181-3/+4
|
* sys/syz-extract: restore kvm const extraction for arm64/ppc64Dmitry Vyukov2021-09-162-18/+32
| | | | | | | | | | | | Change #2755 disabled KVM for arm64/ppc64, but KVM is supported on these arches and has extensive support. It's pity to lose that support. The real root cause of the problem with arm64/ppc64 is that some severe compilation errors terminated compilation and did not let compiler spew all error messages. As the result we did not parse all of them and did not disable all of them. Re-try compilation multiple times instead of just 2 to fix this. Update #2754
* sys: skip kvm const extraction for non i386/amd64Aleksandr Nogikh2021-09-131-5/+7
| | | | | | | | | | | | It is impossible to compile a number of definitions in include/uapi/linux/kvm.h for other platforms, which leads to syz-extract failing to update constants. Skip processing of this file for all arches except i386 and amd64. This is a hacky and (hopefully) temporary solution until #2754 is implemented.
* sys/darwin: initial syscall definitionsPatrick Meyer2021-06-071-0/+2
| | | | Pretty much ripped from freebsd +/- what isn't applicable to darwin.
* sys/syz-extract: added include directories for ck headerSimran Kathpalia2021-05-291-0/+2
|
* sys/syz-extract: move SOURCEDIR check to callerPatrick Meyer2021-05-209-27/+4
|
* sys/syz-extract: initial darwin supportPatrick Meyer2021-05-202-0/+52
|
* sys/syz-extract: clean up const generation on FreeBSDAndrew Turner2021-05-171-3/+9
| | | | | | * Create the correct machine symlink on non-amd64 architectures * Remove an unneeded amd64 include directory * Pass the compiler and C flags from the target to the compiler
* 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: add ieee802154 descriptionsDmitry Vyukov2021-02-121-0/+2
|
* 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
|
* pkg/build: support cross-compilation for linuxDmitry Vyukov2020-11-211-24/+3
| | | | | | We currently only support native build in pkg/build (does not even pass ARCH). Move the existing cross-compilation logic from sys/syz-extract/linux.go and reuse it in both places.
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-262-13/+15
| | | | | | | | | | | | 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
* all: fix dup types in func argsDmitry Vyukov2020-07-041-1/+1
|
* sys/syz-extract: ignore *_kvm.txt on linux/riscv64Tobias Klauser2020-06-261-3/+4
| | | | | | | The Linux RISC-V port in linux-next doesn't support KVM yet. Ignore it for now until KVM support is added upstream. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* target: support of big-endian architecturesAlexander Egorenkov2020-06-239-5/+14
| | | | | | | | | | | | * Introduce the new target flag 'LittleEndian' which specifies of which endianness the target is. * Introduce the new requires flag 'littleendian' for tests to selectively enable/disable tests on either little-endian architectures or big-endian ones. * Disable KD unit test on s390x architecture because the test works only on little-endian architecture. Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
* sys/linux: rename watch_queue.txt to dev_watch_queue.txtAndrey Konovalov2020-06-121-1/+1
|