aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
Commit message (Collapse)AuthorAgeFilesLines
* pkg/csource: detect common mistakes in the common executor headerDmitry Vyukov2019-11-282-2/+39
|
* executor: Add debug message in case devlink namespace move failsJiri Pirko2019-11-281-2/+6
| | | | Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: Fix value of DEVLINK_ATTR_NETNS_FDJiri Pirko2019-11-281-1/+1
| | | | | | | During kernel -net and -next-next trees merge, the value got moved. Fix it. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* Call initialize_devlink_ports only when a device has been createdAndrei Vagin2019-11-261-3/+4
| | | | | | | | | | | | | | | | | | | | gVisor doesn't support netdevsim and NETLINK_GENERIC and without this fix, sys-executor always fails: E openat(AT_FDCWD, /sys/bus/netdevsim/new_device, ...) X openat(AT_FDCWD, /sys/bus/netdevsim/new_device, ...) = 0x0 errno=2 E socket(AF_NETLINK, SOCK_RAW|0x0, NETLINK_GENERIC) X socket(AF_NETLINK, SOCK_RAW|0x0, NETLINK_GENERIC) = 0x0 errno=93 E write(0x2 host:[3], "socket(AF_NETLINK) failed\n", 0x1a) X write(0x2 host:[3], ..., 0x1a) = 0x1a (2.767µs) E write(0x2 host:[3], " (errno 93)\n", 0xc) X write(0x2 host:[3], ..., 0xc) = 0xc (2.729µs) E exit_group(0x43) X exit_group(0x43) = 0x0 (900ns) Cc: Jiri Pirko <jiri@mellanox.com> Fixes: f350e2dc1f59 ("executor: rename devlink port netdevices to defined names") Signed-off-by: Andrei Vagin <avagin@google.com>
* executor: extend USB debug messagesAndrey Konovalov2019-11-191-44/+430
| | | | | When USB_DEBUG is enabled, syzkaller crashes on unknown USB requests. This helps to find missing descriptions for particular USB classes.
* executor: add missing includesDenis Efremov2019-11-191-0/+3
| | | | | | | stdbool.h is required by initialize_devlink_ports(): true define. fcntl.h is required by initialize_devlink_pci(): O_RDONLY define. Signed-off-by: Denis Efremov <efremov@linux.com>
* pkg/csource: rename some optionsDmitry Vyukov2019-11-164-155/+154
| | | | | Rename some options in preparation for subsequent changes which will align names across the code base.
* executor: refactor sandbox flagsDmitry Vyukov2019-11-164-18/+14
| | | | In preparation for future changes.
* executor: rename some macrosDmitry Vyukov2019-11-162-111/+111
| | | | | Rename some macros in preparation for subsequent changes which will align names across the code base.
* pkg/csoruce: test that executor does not mis-spell any of the SYZ_* macrosDmitry Vyukov2019-11-163-28/+48
|
* executor: rename some flagsDmitry Vyukov2019-11-161-13/+13
| | | | | Rename some flags in preparation for subsequent changes which will align names across the code base.
* executor: remove pointless macro checksDmitry Vyukov2019-11-161-5/+2
| | | | | common_bsd.h is used for 3 OSes, so checking if it's any of these 3 OSes is pointless. Remove these checks.
* executor: consider NLMSG_DONE type in netlink_send_ext()Jiri Pirko2019-11-151-0/+4
| | | | | | | | | In case the dump is empty, NLMSG_DONE type message is received from kernel right away. Count with this and return 0. Set the reply_len to 0. Reported-by: Dmitry Vyukov <dvyukov@google.com> Fixes: f350e2dc1f59 ("executor: rename devlink port netdevices to defined names") Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor, pkg/host: update usb raw-gadget interfaceAndrey Konovalov2019-11-151-18/+18
| | | | The patches are being upstreamed and the interface has changed.
* sys/fuchsia: remove deprecated exception APIsDavid Pursell2019-11-141-37/+54
| | | | | | The port-based exception APIs have been deprecated on Fuchsia and will be removed shortly. Delete them from the syscall definitions and modify the Fuchsia executor to use the new channel-based APIs instead.
* executor: rename devlink port netdevices to defined namesJiri Pirko2019-11-141-2/+85
| | | | | | | Devlink port netdevices stay in the form of eth%d. Rename then to defined names so they could be used for system calls. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: pass struct nlmsg to netlink_* helpersJiri Pirko2019-11-141-107/+119
| | | | | | | | Don't rely on global "nlmsg" struct and rather pass the structure to netlink_* helpers. That allows to possibly work with multiple netlink messages (sending while receiving for example) at the same time. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: extend netlink_device_change() to allow name changesJiri Pirko2019-11-141-10/+13
| | | | | | | Extend existing helper netlink_device_change() in order to allow to change netdevice names. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: identify netdev by ifindex in netlink_device_change()Jiri Pirko2019-11-141-1/+1
| | | | | | | IFLA_NAME is going to be used to set the name of the netdevice, so change the handle to be ifindex. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: push out devlink generic netlink id getter into a separate functionJiri Pirko2019-11-141-7/+22
| | | | Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* pkg/csource: Force promotion of 64-bit constant valuesMark Johnston2019-11-081-4/+26
| | | | | | | | | | Constant 64-bit arguments to the variadic syscall(2) must have their width specified explicitly. In practice this is not necessary most of the time, but on amd64/freebsd with clang the compiler can and does store the constant 32-bit value to the stack, leaving garbage in the upper 32 bits. This makes C reproducers somewhat uglier, but I see no other solution.
* pkg/csource: don't run tests if compiler is brokenDmitry Vyukov2019-11-071-0/+8
| | | | | Test presence of a working compiler before running any tests for a target. This helps to make tests pass even if some cross-compilers are not installed properly.
* executor: update the list of raw usb eventsAndrey Konovalov2019-11-051-2/+0
| | | | The number of reported event types changed.
* executor, pkg/host, dashboard/config: rename usb-fuzzer to usb raw-gadgetAndrey Konovalov2019-11-041-87/+86
| | | | The interface is being upstreamed and the name has changed.
* pkg/csource: remove duplicate checkJiri Pirko2019-11-031-3/+0
| | | | | | | Remove a check that was mistakenly added with devlink_pci feature and is duplicate of the existing check. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: fix setup of vxcanDmitry Vyukov2019-11-031-0/+1
| | | | Adding vxcan1 also adds vxcan0. Setup and use both.
* pkg/csource: fix lint warningsDmitry Vyukov2019-11-032-11/+63
| | | | | CI failed: https://travis-ci.org/google/syzkaller/jobs/606730911?utm_medium=notification&utm_source=github_status
* executor: move fixed pci devlink handle into network namespaceJiri Pirko2019-11-034-14/+124
| | | | | | | | In case there is a fixed pci devlink handle "pci/pci/0000:00:10.0" on the system (initial network namespace), it is moved to a working network namespace. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor: create netdevsim deviceJiri Pirko2019-10-251-0/+10
| | | | | | Create testing netdevsim instance with 4 ports. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* syz-fuzzer, executor: Add support for blacklisting data race framesMarco Elver2019-10-221-1/+25
| | | | | This adds support to add frames that have already been in data races, to the KCSAN report blacklist.
* executor/usb: enable endpoints on SET_INTERFACEAndrey Konovalov2019-10-211-50/+187
| | | | | This commit changes syz_usb_control_io to enable the relevant endpoints for the interface being set via a SET_INTERFACE request.
* Change KCSAN info file to debugfsMarco Elver2019-10-081-1/+1
|
* executor, host, csource: Add support to enable KCSANMarco Elver2019-10-043-1/+17
| | | | | | | | | By default, the current KCSAN .config does not enable KCSAN during boot, since we encounter races during boot which would prevent syzkaller from ever executing. This adds support to detect if KCSAN is available, and enables it on the fuzzer host.
* executor, csource: adjust syz_open_dev$hiddev timeoutAndrey Konovalov2019-09-241-5/+6
| | | | Looks like opening hiddev can take up to ~100 ms.
* executor: handle USB IN requests with wLength == 0Andrey Konovalov2019-09-191-3/+6
|
* executor: always provide DEVICE_QUALIFIER USB descriptorAndrey Konovalov2019-09-191-0/+15
|
* executor/fuchsia: close vmo handle in syz_mmap.Marco Vanotti2019-09-121-0/+5
| | | | | | | | | | | | This commit fixes a handle leak in syz_mmap. The bug was pointed out by mdempsky during a code review. The `syz_mmap` function creates a VMO and maps it to a VMAR in the address specified by the `syz_mmap` parameters. Once a VMO is mapped to a vmar, the handle to the vmo can be closed without problems. The new code makes sure that `zx_handle_close(vmo_handle)` gets called before the `syz_mmap` function returns.
* executor/fuchsia: don't crash on syz_mmap failure.Marco Vanotti2019-09-111-3/+7
| | | | | | | | | | | | | | | | | syz_mmap is a pseudo-syscall that can be used by syzkaller in fuzzing programs, however, it is also used to setup the environment for syz-executor. syz-executor already checks the return value[0] when it is used for setting up the environment, so it doesn't make sense for the function to crash (most probably, in a fuzzing program it will be called with arguments that would make it fail). The previous behavior was causing a bunch of "Lost connection to test machine" syzkaller crashes which were meaningless. An example of a program in which syz_mmap would crash would be any program in which the handle to the root vmar is closed before calling syz_mmap. [0]: https://github.com/google/syzkaller/blob/a60cb4cd840ce786236a00480e8bb1025e0c5fef/executor/executor_fuchsia.h#L15
* executor/usb: use UTF16 encoding for default stringAndrey Konovalov2019-09-061-5/+18
| | | | Also respond with lang ID when string #0 is requested.
* executor/usb: fix null-ptr-deref in syz_usb_control_ioAndrey Konovalov2019-09-061-2/+2
|
* executor/usb: improve debugging messagesAndrey Konovalov2019-09-061-9/+9
|
* executor/usb: allow syz_usb_control_io args to be 0Andrey Konovalov2019-09-061-2/+7
|
* sys/linux, executor: basic support for multiple USB interfacesAndrey Konovalov2019-09-061-15/+26
|
* executor: fix sigsegv for default USB string responseAndrey Konovalov2019-09-051-1/+1
|
* all: convert Fuchsia to use "host fuzzing" modeMatthew Dempsky2019-08-271-0/+2
| | | | | | | | | Go support is not a priority for Fuchsia at the moment, so it's preferable to use host fuzzing mode for Fuchsia like currently done for Akaros. This commit basically looks for all the places where there was special logic for OS=="akaros" and extends the same logic for OS=="fuchsia".
* sys/linux, executor: minor USB fixes (#1361)Andrey Konovalov2019-08-231-3/+6
|
* executor: fix procid not declared properly for netbsd (#1358)Andrey Konovalov2019-08-221-1/+1
|
* pkg/csource: fix failing syz-runtest for NetBSDSiddharth M2019-08-212-2/+3
| | | | | | * pkg/csource: fix failing syz-runtest for NetBSD * update common.go
* sys/linux: add basic USB CDC Ethernet descriptions (#1328)Andrey Konovalov2019-08-091-1/+1
|
* executer/common_bsd.h: increase the number of tap/tun devices for NetBSDR3x2019-08-081-0/+6
|