aboutsummaryrefslogtreecommitdiffstats
path: root/executor
Commit message (Collapse)AuthorAgeFilesLines
...
* sys/linux: improve binder descriptionsDmitry Vyukov2019-05-171-5/+5
| | | | | Refine some consts to increase changes of correct programs. Fix some types. Add comments and a test.
* sys/linux: improve binder descriptionsDmitry Vyukov2019-05-161-5/+5
| | | | | | Always pass 3 objects in a transaction. This allows to specify correct offsets for objects. Let's see if this improves coverage.
* sys/linux: use offsetof in ebtablesDmitry Vyukov2019-05-161-5/+5
| | | | Resolve 2 TODOs in ebtables using the new offsetof type.
* pkg/compiler: add offsetof typeDmitry Vyukov2019-05-162-1/+2
| | | | | | Similar to C offsetof gives offset of a field from the beginning of the parent struct. We have several TODOs in descriptions asking for this.
* pkg/compiler: work around 0-array-size errors due to missing constsDmitry Vyukov2019-05-152-2/+3
| | | | | | | A const can be used as array size. Then if the const is not present on all arches, compiler will produce an error about 0-sized-array. There is no easy way to work around this for a user. Use value of 1 for missing consts. It's just a bit safer.
* .golangci.yml: add codeanalysis build tagDmitry Vyukov2019-05-151-17/+17
| | | | | | | | | 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
* sys/linux: improve binder descriptionsDmitry Vyukov2019-05-142-5/+15
| | | | Add few new ioctl's. Add some typedefs for clarity.
* sys/linux: improve key and net_sch descriptionsDmitry Vyukov2019-05-141-5/+5
| | | | Use the len paths to resolve pending TODOs.
* pkg/compiler: allow to refer to syscall arguments in len pathsDmitry Vyukov2019-05-141-1/+1
| | | | This allows to use len[syscall:arg] expressions.
* sys/akaros: rename syscall argumentDmitry Vyukov2019-05-141-1/+1
| | | | In preparation for making syscall a reserved name.
* sys/linux: improve btf descriptionsDmitry Vyukov2019-05-141-5/+5
| | | | | | | | Now that we have the len path expressions we can fix the TODO in btf descriptions to properly specify offsets of btf sections. Also add proper descriptions for btf type section and few other minor things around.
* prog: implement complex len target supportDmitry Vyukov2019-05-141-1/+1
| | | | | This actually implements support for complex len targets during program generation and mutation.
* pkg/compiler: generate complex len targetsDmitry Vyukov2019-05-142-17/+18
| | | | Change the generated format for len type to support multiple path elements.
* sys/linux: switch ppc64le to little-endianDmitry Vyukov2019-05-131-1/+1
| | | | | | | | | | | | | | | | | | 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/openbsd: add missing padding argumentsAnton Lindqvist2019-05-122-1/+3
| | | | | | | | | Due to missing padding arguments, stack garbage could end up being used as actual arguments. More reading for the curious[1]. While here, add missing descriptions for pread and pwrite. [1] https://flak.tedunangst.com/post/syzkaller-found-a-bug
* sys/linux: add few new bpf constsDmitry Vyukov2019-05-102-5/+10
|
* sys/linux: add definitions of fsopen, fspick, fsconfig, fsmount, move_mount ↵Dmitry Vyukov2019-05-102-5/+29
| | | | syscalls
* sys/linux: add new consts/flags/fields here and thereDmitry Vyukov2019-05-102-5/+25
| | | | Add a bunch of new small interfaces in 5.2: new consts, flags, fields, etc.
* sys/linux: add new fou attributesDmitry Vyukov2019-05-101-5/+5
|
* sys/linux: add description of open_tree syscallDmitry Vyukov2019-05-102-5/+7
|
* sys/linux: regenerate consts on the latest linux-next treeDmitry Vyukov2019-05-101-5/+5
| | | | Fuse version was bumped.
* sys/linux: fix alignment of cmsghdr_sockDmitry Vyukov2019-05-101-5/+5
| | | | All cmsg's must be intptr aligned within the array.
* sys/linux: update descriptions of sendmsg/sendmmsgKaipeng Zeng2019-05-102-5/+29
| | | | Fix the descriptions of cmsghdr. Add sendmsg$sock and sendmmsg$sock for __sock_cmsg_send.
* executor: fix 32-bit buildDmitry Vyukov2019-05-071-3/+3
| | | | | Syscall args can't be printed with %lx now. Cast them to uint64 for now since we have only 2 such places.
* executor: change syscall argument type to intptr_tmunjinoo2019-05-077-13/+13
| | | | | The type size of long depends on compiler. Therefore, changing to intptr_t makes it depends on architecture.
* executor: unbreak on OpenBSD at runtimeAnton Lindqvist2019-05-021-0/+4
| | | | | | | | Not using `elif GOOS_freebsd' since it could cause breakage on other *BSDs due to unused variables. Regression introduced in commit c7c3f772 (executor: improve setup for packet handling on *BSD).
* sys/openbsd: add vmm descriptions (#1152)Anton Lindqvist2019-05-012-1/+10
| | | | | | | Most probably limited to input validation for now. In the future, it could be extended to provide a bootable kernel during vm create (/bsd) and turn vmid into a proper resource. The OpenBSD VMs on GCE does support vmm(4).
* executor: improve setup for packet handling on *BSD (#1153)Michael Tüxen2019-05-011-1/+20
| | | | | | | | Improve the handling of packets by: * setting the local MAC address. * configuring the local IPv4 address with prefix /24. * adding an entry in the arp cache for the remote IPv4 address. * adding an entry in the IPv6 neighbour cache for the remote IPv6 address.
* sys/freebsd: add support for various network protocolsMichael Tuexen2019-05-011-1/+1
| | | | | Add support for Ethernet, IPv4, ICMP, IPv6, ICMP6, TCP, and UDP. This work is based on the corresponding Linux support.
* sys/freebsd: include ioccom.h in pf.txtMichael Tuexen2019-04-301-1/+1
| | | | This is needed for the IORW() macros.
* executor: fix another compiler warningAndrey Konovalov2019-04-251-1/+1
|
* executor: fix compiler warningAndrey Konovalov2019-04-241-2/+2
|
* executor: use NONFAILING in common_usb.hAndrey Konovalov2019-04-231-105/+130
| | | | Also move some code to helper functions.
* executor: adjust waiting time for all usb syzcallsAndrey Konovalov2019-04-232-10/+14
| | | | | | Allow 2000 ms of waiting time for syz_usb_connect and and the same time for the whole program is this syzkall is present. Allow 200 ms of waiting time for syz_usb_disconnect. Remove sleep from syz_usb_control_io.
* sys/freebsd: Add pf ioctl()sKristof Provost2019-04-232-1/+60
| | | | | Tweak the building of the FreeBSD vm image to ensure pf is loaded at startup, so that we can test it.
* Update syscalls (#1116)Marco Vanotti2019-04-222-4/+28
| | | | | | | | | * sys/fuchsia: update all syscalls. This commit modifies all the existing syscalls definitions to match more closely the documentation in the Fuchsia repo. * run make extract && make generate
* sys/linux: add pidfd_send_signalDmitry Vyukov2019-04-122-5/+13
|
* sys/linux: more tty descriptionsDmitry Vyukov2019-04-122-5/+114
|
* sys/linux: add simple io_uring descriptionsDmitry Vyukov2019-04-122-5/+38
| | | | | We don't actually communicate with the uring yet, but this already finds a bunch of bugs.
* all: run make generateAndrey Konovalov2019-04-112-5/+25
|
* all: add basic USB fuzzing supportAndrey Konovalov2019-04-114-3/+484
| | | | | | | | | | | | This commits implements 4 syzcalls: syz_usb_connect, syz_usb_io_control, syz_usb_ep_write and syz_usb_disconnect. Those syzcalls are used to emit USB packets through a custom GadgetFS-like interface (currently exposed at /sys/kernel/debug/usb-fuzzer), which requires special kernel patches. USB fuzzing support is quite basic, as it mostly covers only the USB device enumeration process. Even though the syz_usb_ep_write syzcall does allow to communicate with USB endpoints after the device has been enumerated, no coverage is collected from that code yet.
* all: add optional close_fds feature to reproducersAndrey Konovalov2019-04-093-4/+28
| | | | | | | | Instead of always closing open fds (number 3 to 30) after each program, add an options called EnableCloseFds. It can be passed to syz-execprog, syz-prog2c and syz-stress via the -enable and -disable flags. Set the default value to true. Also minimize C repros over it, except for when repeat is enabled.
* csource: use /*FOO*/ instead of [[FOO]]Andrey Konovalov2019-04-091-13/+10
| | | | The latter differently confuses different versions of clang-format.
* sys/openbsd: add pci descriptionsAnton Lindqvist2019-04-052-1/+5
|
* executor: move syz_execute_func after os imports. (#1107)Marco Vanotti2019-04-031-16/+16
| | | | | | | | | | | | | | | | | This commit moves the definition of the `syz_execute_func` after the block of code that imports all the OS specific common headers. This is required because after commit dfd3394d42ddd333c68cf355273b312da8c65a51 `syz_execute_func` started using the `NONFAILING` macro, which is defined in those header files for each OS. I also ran `make generate`. TEST=I only tested that the executor works for Fuchsia with: ```shell $ make executor TARGETOS=fuchsia TARGETARCH=amd64 SOURCEDIR=~/fuchsia ```
* executor: don't fallthrough in switches in fuchsia (#1103)Marco Vanotti2019-04-031-0/+3
| | | | | | This commit modifies the common_fuchsia.h file changing the behavior of the `syz_future_time function`. Before, the function used to have a switch case that would fallthrough, making it always set the delta_ms to 10000. The fix is to add a `break;` statement after each switch case.
* sys/fuchsia: Remove object_*_cookie syscalls. (#1099)Marco Vanotti2019-04-032-6/+2
| | | | | | | | Those syscalls were removed from Zircon in a recent CL[0]. This commit runs make extract && make generate to update syscalls and fidl interfaces. [0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/249349
* executor: try to prevent machine outbreakDmitry Vyukov2019-04-021-1/+13
| | | | | | | | | The fuzzer gained control over host machines again with something like: syz_execute_func(&(0x7f00000000c0)="c4827d5a6e0d5e57c3c3b7d95a91914e424a2664f0ff065b460f343030062e67660f50e900004681e400000100440fe531feabc4aba39d6c450754ddea420fae9972b571112d02") Let's see if perturbing syz_execute_func a bit and wiping registers will stop the outbreak.
* pkg/compiler: make buffer alias to ptr[array[int8]]Dmitry Vyukov2019-04-011-12/+12
| | | | | | | | | | | 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
* executor: connect tun and bpf devices on OpenBSDAnton Lindqvist2019-04-011-1/+1
|