Commit Graph

917 Commits

Author SHA1 Message Date
Andrey Konovalov
6901a56e00 executor/usb: enable endpoints on SET_INTERFACE
This commit changes syz_usb_control_io to enable the relevant endpoints
for the interface being set via a SET_INTERFACE request.
2019-10-21 15:56:03 +02:00
Dmitry Vyukov
d4ea592f78 sys/linux: add some new flags
Add a few new assorted things, some flags, etc.
2019-10-15 14:13:41 +02:00
Dmitry Vyukov
2b7a4c5e69 sys/linux: add exfat descriptions 2019-10-15 13:50:06 +02:00
Dmitry Vyukov
6078bcf4f9 sys/linux: add watch_queue descriptions 2019-10-15 13:50:06 +02:00
Andrey Konovalov
323ca50263 sys/linux/vusb.txt: describe UAC1 device class 2019-10-15 13:08:30 +02:00
Veronica Radu
1a3bad9041 prog: mutate length of output buffers
Update #480
2019-10-10 14:37:42 +02:00
Dmitry Vyukov
2ab6c4a457 sys/linux: improve i2c descriptions a bit 2019-10-08 16:06:26 +02:00
Marco Elver
137e37cac2 Change KCSAN info file to debugfs 2019-10-08 15:04:54 +02:00
Marco Elver
b2f369e56e executor, host, csource: Add support to enable KCSAN
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.
2019-10-04 13:44:09 +02:00
Veronica Radu
9d33246a91 sys/linux: add new syscall descriptions for devio and usbmon
Update #533
2019-10-01 13:55:20 +02:00
Eric Biggers
c7a4fb9986 sys/linux/dev_binder.txt: also support real-world binder device names
It was reported that binder isn't covered when using syzkaller on a real
Android device, since the binder device names are different.  Update the
descriptions to know about the real-world device names too.
2019-09-30 12:36:26 +02:00
Dmitry Vyukov
d8074e0bb9 sys/linux: add new pidfd syscalls 2019-09-27 13:35:42 +02:00
Andrey Konovalov
792da3da86 executor, csource: adjust syz_open_dev$hiddev timeout
Looks like opening hiddev can take up to ~100 ms.
2019-09-24 10:45:51 +02:00
Andrey Konovalov
4d3ae0b784 executor: handle USB IN requests with wLength == 0 2019-09-19 19:31:56 +02:00
Andrey Konovalov
0c00210ff3 executor: always provide DEVICE_QUALIFIER USB descriptor 2019-09-19 19:31:56 +02:00
Paul Chaignon
a32a318486 sys/linux: update BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-19 15:31:20 +02:00
Eric Biggers
eb9400440d sys/linux: re-generate Linux descriptions from next-20190918 2019-09-19 09:38:51 +02:00
Paul Chaignon
c2dcd7009f sys/linux: update BPF's anonymous structures
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-18 06:50:02 +02:00
Paul Chaignon
03e0d24559 sys/linux: basic support for bpf-to-bpf function calls
The BPF template currently only defines helper calls.  BPF function calls
(bpf-to-bpf calls) are however supported in Linux since v4.16.

This patch defines bpf-to-bpf calls in the template.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-17 20:38:59 +02:00
Andrey Konovalov
d555ee7ed1 executor: fix out-of-bounds access to syscalls array
Move accessing syscalls array to check for USB syscalls after we validate
the call_num value (it can be e.g. instr_copyin/out).
2019-09-17 15:10:25 +02:00
Paul Chaignon
c9364a4648 sys/linux: support for loopkup-free map value accesses
A new BPF instruction that allows lookup-free map value accesses was added
in Linux v5.2, with commit d8eca5b ("bpf: implement lookup-free direct
value access for maps").  It enables direct access to map values without
having to call a BPF helper.  It is currently used to implement global
variable support.

This commit adds support for that new instruction.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-09-17 14:41:41 +02:00
Michael Tuexen
cb93629971 sys/freebsd/sys.txt: update sendfile description
The signature of sendfile() on FreeBSD is different from the one
used on Linux.
2019-09-16 10:39:16 +02:00
Michael Tüxen
55c50e708b
sys/freebsd/vnet.txt: replace IPPROTO_SEP by IPPROTO_DCCP (#1401)
r350749 updated the constant from IPPROTO_SEP to IPPROTO_DCCP
to be consistent with the IANA registry.
2019-09-16 09:51:17 +02:00
Marco Vanotti
40fa42bc27 executor/fuchsia: close vmo handle in syz_mmap.
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.
2019-09-12 21:17:27 -03:00
Marco Vanotti
f4e53c1037 executor/fuchsia: don't crash on syz_mmap failure.
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]:
a60cb4cd84/executor/executor_fuchsia.h (L15)
2019-09-11 16:38:45 -03:00
Andrey Konovalov
a60cb4cd84 executor/usb: use UTF16 encoding for default string
Also respond with lang ID when string #0 is requested.
2019-09-06 20:11:54 +02:00
Andrey Konovalov
3fe4b3b1aa executor/usb: fix null-ptr-deref in syz_usb_control_io 2019-09-06 20:11:54 +02:00
Andrey Konovalov
1af11d9328 executor/usb: improve debugging messages 2019-09-06 20:11:54 +02:00
Andrey Konovalov
a381ceb297 sys/linux/usb: fix CDC mac address encoding 2019-09-06 20:11:54 +02:00
Andrey Konovalov
35d270e58c sys/linux/usb: always provide device string ids
This forces the kernel to make a USB string request and select a lang ID
early during the enumaration stage.
2019-09-06 20:11:54 +02:00
Andrey Konovalov
2d7c71133a executor/usb: allow syz_usb_control_io args to be 0 2019-09-06 20:11:54 +02:00
Andrey Konovalov
4280382fb9 sys/linux/vusb.txt: properly describe interfaces for USB CDC NCM
Also rename cdc_ethernet to cdc_ecm.
2019-09-06 17:19:55 +02:00
Andrey Konovalov
a38da1b89a sys/linux, executor: basic support for multiple USB interfaces 2019-09-06 17:19:55 +02:00
Andrey Konovalov
c16be727a6 executor: fix sigsegv for default USB string response 2019-09-05 19:03:35 +02:00
Andrey Konovalov
bf6bcce4f2 sys/linux/vusb.txt: fix typo in descriptions 2019-09-05 16:28:13 +02:00
Veronica Radu
5de425bc59 prog: implemented argument and call priorities 2019-09-04 10:46:46 +02:00
Andrey Konovalov
12381952e3 sys/linux/vusb.txt: fix unused EPSNUM param 2019-09-04 07:10:15 +02:00
Matthew Dempsky
fd37b39ea8 all: convert Fuchsia to use "host fuzzing" mode
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".
2019-08-27 14:39:18 -07:00
Andrey Konovalov
78ded1969a
sys/linux, executor: minor USB fixes (#1361) 2019-08-23 14:50:37 +02:00
Andrey Konovalov
ca6f3cfa78
sys/linux: fix bNumEndpoints in a USB interface (#1360)
bNumEndpoints is defined as len[endpoints]. This initially assumed that
endpoints is an array, which is not the case for descriptions for
particular USB classes. Improve it by defining a new template for interfaces
and passing in a value range for bNumEndpoints for these cases.
2019-08-22 19:53:52 +02:00
Andrey Konovalov
c6c81a0bd3
executor: fix procid not declared properly for netbsd (#1358) 2019-08-22 14:49:06 +02:00
Andrey Konovalov
0d298d6b2e
sys/linux: add basic USB CDC NCM descriptions (#1337)
CDC NCM support is incomplete, as it requires support for describing multiples
interfaces per configuration.
2019-08-14 21:05:27 +02:00
Andrey Konovalov
27bd5400c8
sys/linux: fix USB string descriptors (#1336)
They should either contain a lang id or a string.

Do some other minor fixes as well.
2019-08-14 18:25:24 +02:00
Marco Vanotti
770d4e1bc7 sys/fuchsia: update socket syscalls 2019-08-14 09:34:25 +02:00
Anton Lindqvist
8620c2c258 sys/openbsd: add ktrace description 2019-08-12 11:16:16 +02:00
Anton Lindqvist
e44fc68a53 sys/openbsd: add acct description 2019-08-12 11:16:16 +02:00
Anton Lindqvist
62d3ec4876 sys/openbsd: add speaker descriptions 2019-08-12 11:16:16 +02:00
Andrey Konovalov
acb5163814
sys/linux: add basic USB CDC Ethernet descriptions (#1328) 2019-08-09 19:46:27 +02:00
Veronica Radu
aff9e255cd prog: add special mutation for binary flags 2019-08-09 15:02:02 +02:00
Andrey Konovalov
d545e945ce sys/linux: add syz_open_dev$char_usb descriptions
syz_open_dev$char_usb opens char devices with major = USB_MAJOR.
Sanitize its values to make sure it doesn't open other char/block devices.
2019-08-08 15:34:27 +02:00