aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract/fetch.go
Commit message (Collapse)AuthorAgeFilesLines
* 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-041-8/+8
| | | | | 1) Make FabricateSyscallConsts() operate on ConstFile. 2) Expose Pos inside ConstInfo.
* all: use special placeholder for errorsTaras Madan2023-07-241-4/+4
|
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-2/+2
|
* sys/syz-extract: restore kvm const extraction for arm64/ppc64Dmitry Vyukov2021-09-161-11/+27
| | | | | | | | | | | | 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
* target: support of big-endian architecturesAlexander Egorenkov2020-06-231-3/+4
| | | | | | | | | | | | * 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/syz-extract: add another compiler message about missing constDmitry Vyukov2020-05-111-0/+1
| | | | New message from clang.
* 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: extract constants from ELFDmitry Vyukov2019-12-021-28/+86
| | | | | | | | | | | | | 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: fix too long lineDmitry Vyukov2019-07-161-1/+1
|
* sys/syz-extract: Add "DefineGlibcUse" flag.Marco Vanotti2019-07-161-11/+15
| | | | | | 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/linux: switch ppc64le to little-endianDmitry Vyukov2019-05-131-1/+2
| | | | | | | | | | | | | | | | | | 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: support more identifier quoting optionsDmitry Vyukov2019-03-141-4/+3
| | | | That's insanity compilers shuffle them in all possible combinations.
* 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.
* all: fix too long linesDmitry Vyukov2018-05-051-1/+2
| | | | | Not sure why I have not seen warnings about these lines on another machine...
* sys/syz-extract: fix linux/armDmitry Vyukov2018-04-021-0/+2
| | | | | | | | | | | | | | | At some point extract for linux/arm started to fail with: extracting from key.txt failed to run compiler: exit status 1 /tmp/ccT6o7iZ.s: Assembler messages: /tmp/ccT6o7iZ.s:4: Error: unknown pseudo-op: `.syntax' This is caused by arch/arm/include/asm/unified.h: __asm__(".syntax unified"); Ignore all __asm__ directives as we are cross compiling.
* sys/syz-extract: fix compiler invocationDmitry Vyukov2017-11-201-2/+1
|
* pkg/osutil: don't leace runaway processesDmitry Vyukov2017-11-161-4/+4
| | | | | | When manager is stopped there are sometimes runaway qemu processes still running. Set PDEATHSIG for all subprocesses. We never need child processes outliving parents.
* syz-extract: fix printf conditional in templateEric Biggers2017-11-071-1/+1
| | | | | | commit 3520854be0e7 ("syz-extract: select declaring printf or not") broke 'make extract' because it introduced invalid syntax in a text template. Fix it.
* syz-extract: select declaring printf or notzoulasc2017-11-061-9/+13
| | | | | | | | Kernels are standalone implementations and can have their own implementations of functions that have different prototypes than the standard ones. In the NetBSD case the kernel printf returns void, and it is declared in <sys/systm.h> so avoid re-declaring it. Select if we are going to declare printf or not depending on the OS.
* sys/fuchsia: more descriptionsDmitry Vyukov2017-10-161-0/+1
|
* sys/syz-extract: support akarosDmitry Vyukov2017-10-161-0/+1
|
* sys/syz-extract: factor out compilation functionDmitry Vyukov2017-10-121-0/+159
| | | | | | | Each arch duplicates significant portion of logic to compile the extract source file. Factor this logic into a separate function and reuse it across all OSes.
* sys/syz-extract: support fuchsiaDmitry Vyukov2017-09-251-173/+0
|
* sys/targets: move targets from sys packageDmitry Vyukov2017-09-151-3/+3
| | | | | | | This breaks circular dependency between: sysgen -> sys/linux -> sys -> sysgen With this circular dependency it is very difficult to update format of generated descriptions because sysgen does not build.
* sys/syz-extract: generate build files out of treeDmitry Vyukov2017-09-151-18/+19
| | | | | This does not pollute user kernel dir (we do make mrproper, though) and enables parallel generation.
* sys/syz-extract: switch to consolidated target info in sys packageDmitry Vyukov2017-09-151-6/+9
|
* sys/syz-extract: parallelize over filesDmitry Vyukov2017-09-151-12/+12
|
* pkg/compiler, sys/syz-sysgen: move const handling to pkg/compilerDmitry Vyukov2017-08-271-1/+6
| | | | Now pkg/compiler deals with consts.
* sys: support arm archDmitry Vyukov2017-08-191-2/+2
| | | | | | | Not tested, but const extraction and build works. Update #324 Update #191
* sys/syz-extract: reformatDmitry Vyukov2017-06-261-1/+1
|
* Parse incdir "incdir" in syscall description file to add custom include ↵Yuzhe Han2017-06-261-6/+8
| | | | | | | | | | | | directories. (#180) * Parse #incdir "incdir" in syscall description file to add custom include directories. * add flagLinux * remove '#' in incdir flag * Update sys/README.md AUTHORS CONTRIBUTORS.
* sys/syz-extract: move from syz-extractDmitry Vyukov2017-06-171-0/+162