aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract
Commit message (Collapse)AuthorAgeFilesLines
...
* sys/linux: rename mptcp.txt to vnet_mptcp.txtAndrey Konovalov2020-06-121-1/+1
|
* sys/fuchsia: update "make extract" support codeMatthew Dempsky2020-06-051-8/+12
| | | | | | | FIDL fuzzing hasn't been working for a while, and it's further bit-rotted as upstream FIDL functionality has continued to evolve. This commit updates enough FIDL functionality to get a minimal FIDL test case to work again.
* sys/syz-extract: fix for full pathsDmitry Vyukov2020-05-202-3/+3
| | | | | pkg/ast now uses full paths since 554f8f39c57d91c1be8724cf4054424c9fb5f151. Fix syz-extract accordingly.
* targets: syz-extract: add Clang support for Linux buildsAlexander Potapenko2020-05-151-0/+6
| | | | | | | | | | | | Allow targets.go use Clang instead of the default Linux compiler by setting the SYZ_CLANG=1 env var. Doing so changes the compiler to "clang" and the linker to "ld.ldd", assuming they are in $PATH, and adds the --target and -ferror-limit CFLAGS. Target also exports KernelCompiler and KernelLinker fields now, which allows overriding the compiler and linker in the kernel make invocation. Signed-off-by: Alexander Potapenko <glider@google.com>
* targets: replace target.CCompilerPrefix with target.TripleAlexander Potapenko2020-05-151-2/+4
| | | | | | | This field will soon be used in Clang builds. Also, we'd better encapsulate compiler name generation in targets.go Signed-off-by: Alexander Potapenko <glider@google.com>
* Get rid of "Cross" in variable namesAlexander Potapenko2020-05-131-2/+2
| | | | | | | | | Renamed Target.BrokenCrossCompiler to Target.BrokenCompiler and Target.CrossCFlags to Target.CFlags "Everything in Target is about Cross now." Signed-off-by: Alexander Potapenko <glider@google.com>
* sys/syz-extract: use -nostdinc on linuxDmitry Vyukov2020-05-111-13/+22
| | | | This makes the build completely hermetic.
* 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: add another compiler message about missing constDmitry Vyukov2020-05-111-0/+1
| | | | New message from clang.
* sys/syz-extract: run mrproper for all linux archesDmitry Vyukov2020-05-099-21/+26
| | | | | | 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/linux: regenerate constsDmitry Vyukov2020-04-141-6/+14
| | | | | | | | | | | On the current linux-next: f19bb13a0eaf0034a603e3b54a7c3a50faf6821e (next-20200414) EXT4_EOFBLOCKS_FL was removed by 4337ecd1fe997d2b2135b4434caaccdb47c10c06 ARM does not support KVM anymore, removed by 541ad0150ca4 ("arm: Remove 32bit KVM host support"). Fixes #1676
* sys/syz-extract: favor clang on OpenBSDAnton Lindqvist2020-03-041-1/+1
| | | | | Clang is the default compiler on amd64 which is the only supported architecture by syzkaller right now.
* sys/syz-extract: fix handling of odd prefixed syscalls on OpenBSDAnton Lindqvist2020-03-041-13/+18
| | | | This makes syz-extract work again on OpenBSD.
* 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: don't redefine __asm__ in ELF modeDmitry Vyukov2019-12-171-0/+2
| | | | | | | | | | | | This is not necessary since we build legit object file for the target binary now. But this breaks mips with: /linux/arch/mips/include/asm/thread_info.h:53:30: error: register name not specified for ‘__current_thread_info’ register struct thread_info *__current_thread_info __asm__("$28"); So just remove the old hack. Follow up to #1536
* sys/syz-extract: Add mips64le specific include pathsJouni Hogander2019-12-171-0/+2
| | | | | Couple of include paths are needed for syz-extract to work for mips64ler2.
* sys/syz-extract: extract constants from ELFDmitry Vyukov2019-12-0210-62/+123
| | | | | | | | | | | | | 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-012-1/+19
| | | | | | | 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/linux: update to current linux-nextDmitry Vyukov2019-11-251-1/+5
| | | | | | | | Regenerate consts on linux-next next-20191125. DEVLINK_ATTR_NETNS_* consts were chifted by 1. __BPF_FUNC_MAX_ID increased as usual. CRYPTO_ALG_TYPE_BLKCIPHER, CRYPTO_ALG_TYPE_ABLKCIPHER were removed, replace them with CRYPTO_ALG_TYPE_SKCIPHER.
* sys/fuchsia: fix Fuchsia extract/generateDavid Pursell2019-11-141-1/+1
| | | | | Updates some paths and add zx_eventpair type definition to fix `make extract` and `make generate`.
* 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/syz-extract: fix too long lineDmitry Vyukov2019-07-161-1/+1
|
* sys/syz-extract: Add "DefineGlibcUse" flag.Marco Vanotti2019-07-169-19/+23
| | | | | | Instead of defining the __GLIBC_USE macro on every OS, we are just defining it based on a parameter. That parameter is set to false for all OSs except for fuchsia.
* sys/syz-extract: define __GLIBC_USE if not defined.Marco Vanotti2019-07-161-0/+4
| | | | | | | | When I try to run `make extract` for fuchsia, the clang compiler complains that __GLIBC_USE is undefined. This CL just defines it to be an always false function-like macro if it was not defined.
* sys: Updating Fuchsia extraction scriptsPascal Perez2019-05-211-2/+4
| | | | | | | | | Consolidating FIDL library build mappings in one place, so that it can be used from extraction, and script invoking fidlgen. This also makes code clearer, and provides a more natural path for evolutions / dealing with oddities. Minor doc update post fx command changes.
* sys/linux: switch ppc64le to little-endianDmitry Vyukov2019-05-132-11/+12
| | | | | | | | | | | | | | | | | | make extract recently broke for powerpc on linux-next with: include/uapi/linux/byteorder/big_endian.h:6:2: error: #error "Unsupported endianness, check your toolchain" #error "Unsupported endianness, check your toolchain" Turns out we always built ppc64le headers as big-endian. First, kernel was configured as BE. Then, we used gcc to build an executable program for host and on x86 gcc does not define __LITTLE_ENDIAN__ so kernel thought that the toolchain is BE too. Configure kernel as LE and define __LITTLE_ENDIAN__. This actually changes values of some consts, but fortunately just few of them.
* sys/syz-extract define GENOFFSET when processing FreeBSD sourcesMichael Tuexen2019-04-301-0/+1
| | | | This avoids the inclusion of offset.inc files.
* sys/syz-extract: fix too long lineDmitry Vyukov2019-03-271-1/+2
|
* sys/sys-extract: update import path for fuchsia.Marco Vanotti2019-03-271-1/+1
| | | | | | | | | | 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/syz-extract: support more identifier quoting optionsDmitry Vyukov2019-03-141-4/+3
| | | | That's insanity compilers shuffle them in all possible combinations.
* 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/freebsd: avoid mangling syscall namesMark Johnston2019-03-071-29/+1
| | | | | | | | | | | | | | | | | syz-extract was removing certain prefixes from syscall names, but this caused some problems: - freebsd* prefixes are for compatibility syscalls when the syscall ABI has changed. For instance, we have both fstat() and freebsd11_fstat(), and it is desirable to fuzz them both. - Stripping prefixes may leave us with undefined SYS_ constants. This resulted in some test failures in pkg/csource, which emitted code referencing SYS_semctl when it should have been SYS___semctl. Fix the problem by updating syscall descriptions to match the names given by the FreeBSD kernel. Add some new descriptions for compatibility syscalls, fix the mknodat() description (dev_t is now 64 bits wide on FreeBSD), and remove mknod$loop, which appears to be Linux-specific.
* sys/linux: regenerate constsDmitry Vyukov2019-02-121-1/+1
| | | | Regenereate consts on latest linux-next.
* sys/linux: fix up mptcp descriptionsDmitry Vyukov2019-01-252-5/+14
| | | | | | | 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: don't use warning flagsDmitry Vyukov2019-01-241-1/+7
| | | | | CrossCFlags now contains some warning-related flags like -Wall. Some of these break kernel build, don't add any warning-related flags.
* sys/syz-extract: add -includedirs optionJoey Jiao2019-01-197-12/+47
| | | | | | 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-072-0/+38
| | | | | | | | | 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.
* sys/syz-extract: support missing arch headersDmitry Vyukov2018-10-281-0/+17
| | | | | | | | The latest Linux kernel misses some arch-specific headers on some archs: asm/a.out.h asm/prctl.h asm/mce.h Support that.
* sys: check that target consts are definedDmitry Vyukov2018-10-191-0/+1
| | | | | | | | | | | | | | 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
* Add mandatory OpenBSD bits (#689)Anton Lindqvist2018-08-282-0/+87
| | | | | | | | | | | | | | | | | | 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/fuchsia: description for fuchsia.io FIDL interfacesDokyung Song2018-08-271-0/+2
|
* 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
* sys/akaros: add all syscallsDmitry Vyukov2018-07-061-2/+7
|
* 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.
* pkg/osutil: introduce TempFile helperDmitry Vyukov2018-05-141-23/+9
| | | | Introduce TempFile helper and use it in several packages.
* sys/syz-extract: improve compier error messagesDmitry Vyukov2018-05-111-1/+2
| | | | | | | Print each constant on separate line. When compiler prints error messages it prints whole line containing an error. So currently it prints all constants (thousands). With this change it prints just the problematic constant.