Commit Graph

5523 Commits

Author SHA1 Message Date
Anton Lindqvist
96dd36234d executor: enable extra coverage on OpenBSD
Recently added[1] to the kcov implementation on OpenBSD.

[1] 8430bc4bce
2020-08-02 08:41:09 +02:00
Dmitry Vyukov
d895b3be2c .github/workflows: check commit description format
Check PR commit subjects for the standard format we use "pkg/name: description of the change".
Check PR commit bodies for at most 120 characters.
2020-07-31 17:22:18 +02:00
Pedro Lopes
53dd7c4e25 dashboard/app: Receive Recipients from API
Changed `api.go` to receive Recipients struct and merge it with
Maintainers.
2020-07-31 17:18:29 +02:00
Pedro Lopes
242b0eb219 pkg: get and store Maintainers data
Create a struct on pkg/vcs to store data of syzkaller email recipients
and update its users. The struct contains default name, email, and a
label to divide user into To and Cc when sending the emails.
2020-07-31 17:18:29 +02:00
Pedro Lopes
68aca71e8d dashboard/dashapi: create Recipients
Create struct Recipients to store a slice structs (RecipientInfo) of
email, default name, and if the user should be added to To or Cc when
sending the email. After this commit Commit::Cc and Crash::Maintainers
will become deprecated.
2020-07-31 17:18:29 +02:00
Ayushi Sharma
8df85ed988
sys/netbsd: Adding syscalls related to mount(2),uname(2) and sockets (#1976)
* sys/netbsd: Adding syscalls related to mount(2),uname(2) and sockets

* sys/netbsd: Adding missing flags for fstatat(2)

* sys/netbsd: reordering rlimit_type

* sys/netbsd: reordering flags for stat(2) and mount(2)
2020-07-30 14:42:32 +02:00
Dmitry Vyukov
056be1b9c8 sys/linux: assorted improvements for vhci
Regenerate const files on next-20200729.

Change conn handle to 200 because it also seems to be matches
against phy_handle fields which are int8 (current 256 does not fit into int8).
Use 200 for all handle's and all phy_handle's.

Remove hci_evt_le_cis_req, it does not seem to be used in the kernel.

Restrict some event types and statuses.

Add rssi field to hci_ev_le_advertising_info.

Use bytesize for some of the data length fields.
2020-07-30 13:31:33 +02:00
TheOfficialFloW
b094755316
all: initialize vhci in linux
* all: initialize vhci in linux

* executor/common_linux.h: improve vhci initialization

* pkg/repro/repro.go: add missing vhci options

* executor/common_linux.h: fix type and add missing header

* executor, pkg: do it like NetInjection

* pkg/csource/csource.go: do not emit syz_emit_vhci if vhci is not enabled

* executor/common_linux.h: fix format string

* executor/common_linux.h: initialize with memset

For som reason {0} gets complains about missing braces...

* executor/common_linux.h: simplify vhci init

* executor/common_linux.h: try to bring all available hci devices up

* executor/common_linux.h: find which hci device has been registered

* executor/common_linux.h: use HCI_VENDOR_PKT response to retrieve device id

* sys/linux/dev_vhci.txt: fix structs of inquiry and report packets

* executor/common_linux.h: remove unnecessary return statement and check vendor_pkt read size

* executor/common_linux.h: remove unnecessary return statement and check vendor_pkt read size

* sys/linux/dev_vhci.txt: pack extended_inquiry_info_t

* sys/linux/l2cap.txt: add l2cap_conf_opt struct

* executor/common_linux.h: just fill bd addr will 0xaa

* executor/common_linux.h: just fill bd addr will 0xaa
2020-07-30 11:33:48 +02:00
Nazime Hande Harputluoglu
233283a191 sys/linux: descriptions for /dev/snd/hw* 2020-07-29 15:49:04 +02:00
Necip Fazil Yildiran
cbca8e0f04 executor: added syz_io_uring_setup to wrap both setup and mmap
It is hard for the fuzzer to generate correct programs using mmap calls
with fuzzer-provided mmap length. This wrapper ensures correct length
computation.
2020-07-29 13:44:49 +02:00
Dmitry Vyukov
a3d497bf6c all: fix marking of auto-generated files
Update the copyright checking script and more files
for the standard convention of marking auto-generated files.
2020-07-29 13:36:11 +02:00
Dmitry Vyukov
9534e89c79 all: mark auto-generated files
Use the standard Go convention for Go files:
https://golang.org/pkg/cmd/go/internal/generate
Use github linguish for other files:
https://github.com/github/linguist#generated-code

Both are understood by github and should result
in these files being collapsed in PRs by default.
2020-07-29 12:55:55 +02:00
Dmitry Vyukov
8ab0cf5b55 .gitignore: add *.tmp
Common temp file extension.
2020-07-29 12:55:05 +02:00
Nazime Hande Harputluoglu
002adf19d0 sys/linux: descriptions for /dev/sequencer 2020-07-29 12:24:15 +02:00
Anton Lindqvist
19a8de55e5 docs/openbsd: update found bugs.md 2020-07-29 08:15:18 +02:00
Anton Lindqvist
cb93dc6ac6 pkg/report: flag short uvm_fault reports as corrupted
They don't contain enough context to be useful.

This change makes `testdata/openbsd/report/0` to be treated as
corrupted, which is desirable since it also lacks context.
2020-07-27 07:46:35 +02:00
Dmitry Vyukov
6e2b10b1a4 docs: add section on descriptions testing
The sys/OS/test/* tests are currently mostly undocumented.
Add initial documentation for these tests.

The "External Dependencies" section is just moved with no changes.
2020-07-27 07:45:19 +02:00
Ayushi Sharma
512651955a
Adding ksem family of syscalls (#1972)
* sys/netbsd: adding ksem related syscalls

* sys/netbsd: adding missing header files to lwp.txt

* sys/netbsd: updating descriptions for ksem family syscalls

* sys/netbsd: updating descriptions for ksem family syscalls
2020-07-26 10:19:16 +02:00
Albert van der Linde
1f7cc1ca26 sys/linux: add description for copy_file_range 2020-07-25 07:05:51 +02:00
Necip Fazil Yildiran
0a13649c05
sys/linux: enhanced descs for io_uring
* sys/linux: enhanced descs for io_uring

Introduced pseudo-call "syz_io_uring_put_sqes_on_ring()" for writing
submission queue entries (sqes) on sq_ring, which was obtained by
mmap'ping the offsets obtained from io_uring_setup().

Added descriptions for io_ring_register operations that were missing
earlier.

Did misc changes to adapt the descriptions for the updates on the
io_uring subsystem.

* pkg/host: add io_uring pseudo-syscall

* executor/common_linux.h: fix issues with io_uring pseudo-syscall

* executor: fixed io_uring offset computation

* executor: fixes and refactorings in syz_io_uring_submit()

* executor: added syz_io_uring_complete() pseudo-syscall for io_uring

* sys/linux: added descriptions for io_uring operations

Each operation requires a different struct io_uring_sqe set up. Those
are described to be submitted to the sq ring.

* executor: use uint32 instead of uint32_t

* executor: remove nonfailing from pseudo-calls

* sys/linux: fix io_uring epoll_ctl sqe

* prog: fix TestTransitivelyEnabledCallsLinux()

The newly introduced syscall, syz_io_uring_submit$IORING_OP_EPOLL_CTL,
uses fd_epoll. Adapt TestTransitivelyEnabledCallsLinux() to account for
this.

* sys/linux: add IORING_OP_PROVIDE_BUFFERS and IORING_OP_REMOVE_BUFFERS

* sys/linux: fix IORING_OP_WRITE_FIXED and IORING_OP_READ_FIXED

addr and len are for the buffer located at buf_index

* sys/linux: io_uring: use reg. bufs for READ, READV, RECV, RECVMSG

As a result, IOSQE_BUFFER_SELECT_BIT is included in the iosqe_flags.

* sys/linux: io_uring: misc fixes

* sys/linux: io_uring: add IORING_SETUP_ATTACH_WQ

* executor: refactorings on io_uring pseudo syscalls

* sys/linux: io_uring: fix desc for params.cq_entries

* executor: fix SQ_ARRAY_OFFSET computation

This is required with the fix in io_uring kernel code.
https://lore.kernel.org/io-uring/CACT4Y+bgTCMXi3eU7xV+W0ZZNceZFUWRTkngojdr0G_yuY8w9w@mail.gmail.com/T/#t

* executor: added pseudosyscall syz_io_uring_cq_eventfd_toggle()

The usage of cq_ring->flags is only for manipulating
IORING_CQ_EVENTFD_DISABLED bit. This is achieved by a pseudo-syscall,
which toggles the bit.

* executor: added pseudocall syz_io_uring_put_ring_metadata

Removed syz_io_uring_cq_eventfd_toggle() and introduced
syz_io_uring_put_ring_metadata() instead. We have many pieces of
metadata for both sq_ring and cq_ring, for which we are given the
offsets, and some of are not supposed to be manipulated by the
application. Among them, both sq and cq flags can be changed. Both valid
and invalid cases might cause interesting outcomes. Use the newly
introduced pseudo syscall to manipulate them randomly while also
manipulating the flags to their special values.

* executor: added pseudo-syscall syz_memcpy_off

Removed syz_io_uring_put_ring_metadata() and instead added a much more
generic pseudo systemcall to achieve the task. This should benefit other
subsystems as well.

* sys/linux: refactored io_uring descriptions

syz_io_uring_submit() is called with a union of sqes to reduce
duplication of other parameters of the function.

io_uring_sqe is templated with io_uring_sqe_t, and this template type is
used to describe sqes for different ops.

The organization of io_uring.txt is changed.

* sys/linux: io_uring: improved descs to utilize registered files

The files are registered using
io_uring_register$IORING_REGISTER_FILES(). When IOSQE_FIXED_FILE_BIT is
enabled in iosqe_flags in sqe, a variety of operations can use those
registered files using the index of the file instead of fd.

Changed the sqe descriptions for the eligible operations to utilize
this.

* sys/linux: io_uring: improved the descs to utilize personality_id in sqes

A personality_id can be registered for a io_uring fd using
io_uring_register$IORING_REGISTER_PERSONALITY(). This id can be utilized
within sqes. This commit improves the descs for io_uring to utilize it.

In addition, the descriptions for the misc field in io_uring_sqe_t is
refactored as most are shared among sqes.

* sys/linux: io_uring: utilized cqe.res

io_uring_cqe.res is used to carry the return value of operations
achieved through io_uring. The only operations with meaningful return
values (in terms of their possible usage) are openat and openat2. The
pseudo-syscall syz_io_uring_complete() is modified to account for this
and return those fds. The description for sqe_user_data is splitted into
two to identify openat and non-openat io_uring ops.

IORING_OP_IOCTL was suggested but never supported in io_uring. Thus, the
note on this is removed in the descriptions.

tee() expects pipefds, thus, IORING_OP_TEE. The descriptions for the
pipe r/w fds are written as ordinary fd. Thus, in the description for
IORING_OP_TEE, which is io_uring_sqe_tee, fd is used in the place where
pipefds are expected. The note on this is removed in the descriptions.

* sys/linux/test: added test for io_uring

This is not tested yet.

* sys/linux/test: fixed the test for io_uring

The changes successfully pass the sys/linux/test/io_uring test.

sys/linux/io_uring.txt: sq_ring_ptr and cq_ring_ptr are really the same.
Thus, they are replaced with ring_ptr.

executor/common_linux.h: thanks to io_uring test, a bug is found in
where the sq_array's address is computed in syz_io_uring_submit().
Fixed. In addition, similar to the descriptions, the naming for the
ring_ptr is changed from {sq,cq}_ring_ptr to ring_ptr.

* sys/linux: io_uring: misc fixes

* sys/linux: io_uring: changed the sqe_user_data enum

Used a smaller range to ease the collisions. Used comperatively unique
and magic numbers for openat user_data to avoid thinking as if the cqe
belongs to openat while the user_data is coming from some random
location.

* pkg/host: added checks for io_uring syscall

* pkg/host: fixed checks for io_uring syscall

* sys/linux: fixed io_uring test
2020-07-24 18:51:04 +02:00
Necip Fazil Yildiran
83892305a5 sys/linux: fixed p{read,write}{v,v2} descriptions
The raw system calls have call signatures that differ slightly from
that of the corresponding GNU C library wrapper functions. The descriptions
are fixed to reflect the raw system calls, which unpacks the offset into
two args, off_l and off_h.
2020-07-24 13:20:16 +02:00
Necip Fazil Yildiran
664cf58ee8 sys/linux: added descs for preadv2, pwritev2 2020-07-24 13:20:16 +02:00
Ioana-Ruxandra Stancioi
554af3885f CONTRIBUTORS: add Ioana-Ruxandra Stancioi 2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
b9a80ab13a sys/linux: add lwtunnel_encap_seg6_local
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/seg6_local.h#L21
https://elixir.bootlin.com/linux/latest/source/net/ipv6/seg6_local.c#L649
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
20595c07c6 sys/linux: add lwtunnel_encap_bpf description
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/lwtunnel.h#L102
https://elixir.bootlin.com/linux/latest/source/net/core/lwt_bpf.c#L364
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
327a211f77 sys/linux: add lwtunnel_encap_seg6 description
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/seg6_iptunnel.h#L22
TODO: uncomment after the kernel fixes the seg6_iptunnel.h uapi header
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
71ff42db4d sys/linux: add lwtunnel_encap_ip6 description
https://elixir.bootlin.com/linux/latest/source/net/ipv4/ip_tunnel_core.c#L713
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
3951d78efc sys/linux: add lwtunnel_encap_ila description
https://elixir.bootlin.com/linux/latest/source/net/ipv6/ila/ila_lwt.c#L121
The comment is about their statement in the kernel file:
https://elixir.bootlin.com/linux/latest/source/net/ipv6/ila/ila_lwt.c#L196
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
b6d666e5f3 sys/linux: add lwtunnel_encap_ip description
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/lwtunnel.h#L102
https://elixir.bootlin.com/linux/latest/source/net/ipv4/ip_tunnel_core.c#L219
The policies added have a suffix (_lwt), because they already exist in syzkaller
with the kernel name. An example of a union with the same name described in
sys/linux/socket_netlink_route_sched.txt:
https://elixir.bootlin.com/linux/latest/source/net/sched/cls_flower.c#L709
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
6d8002b4d3 sys/linux: add lwtunnel_encap_mpls description
https://elixir.bootlin.com/linux/latest/source/net/mpls/mpls_iptunnel.c#L25
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
af21691607 sys/linux: add ipv6_rpl_sr_hdr description
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/rpl.h#L19
update google#533
2020-07-24 12:25:04 +02:00
Ruxandra Stăncioi
7d947eb36b sys/linux: add netlink encap type LWTUNNEL_ENCAP_RPL
Added a new encap type, from the lwtunnel_encap_types struct, defined in the
include/uapi/linux/lwtunnel.h file.
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/lwtunnel.h#L16
Update #533.
2020-07-24 12:25:04 +02:00
Dmitry Vyukov
70c104a18f pkg/compiler: fix crash on fmt[flags]
Flags with only 1 value 0 are transformed to ConstType.
Fmt did not expect that.

Fixes #1965
2020-07-23 17:13:55 +02:00
Denis Efremov
340ea5301c sys/linux: remove ioctl$EXT4_IOC_SETFLAGS
It duplicates ioctl$FS_IOC_SETFLAGS. There is no need in a
separate definition.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 08:49:14 -07:00
Denis Efremov
38237e24ca sys/linux: make fs flags explicit in ioctl$FS_IOC_SETFLAGS
Make fs flags explicit in FS_IOC_SETFLAGS, FS_IOC_GETFLAGS
ioctls.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 08:49:14 -07:00
Denis Efremov
db2522a1a7 sys/linux: change argument type in FS_IOC_[GS]ETFLAGS ioctl
FS_IOC_GETFLAGS, FS_IOC_SETFLAGS ioctls use pointer to int32.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 08:49:14 -07:00
Albert van der Linde
5c22da4628 syz/linux: fix formating 2020-07-22 17:25:36 +02:00
Albert van der Linde
8d15279dc3 sys/linux: add descriptions for RTM_(NEW|DEL|GET)MDB
https://elixir.bootlin.com/linux/latest/source/net/bridge/br_mdb.c#L837
2020-07-22 16:28:44 +02:00
Albert van der Linde
35be432a74 sys/linux: add descriptions for RTM_(NEW|DEL|GET)VLAN
https://elixir.bootlin.com/linux/latest/source/net/bridge/br_vlan.c#L2045
2020-07-22 16:28:44 +02:00
Albert van der Linde
ceb0013c7f sys/linux: add descriptions for RTM_(NEW|DEL|GET)ADDRLABEL
https://elixir.bootlin.com/linux/latest/source/net/ipv6/addrlabel.c#L625
2020-07-22 16:28:44 +02:00
Albert van der Linde
abbd98bb91 sys/linux: add descriptions for RTM_(NEW|DEL|GET)LINKPROP
https://elixir.bootlin.com/linux/latest/source/net/core/rtnetlink.c#L5565
2020-07-22 16:28:44 +02:00
Denis Efremov
128cd85fcc sys/linux: cleanup orphaned const files for s390x
These *s390x.const files don't match existing
*.txt files.

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-22 07:50:57 +02:00
Andrey Konovalov
21f1765e15 prog: more interations in prio test 2020-07-21 16:47:38 +02:00
Andrey Konovalov
a688ac1353 sys/linux: disable SNAPSHOT_POWER_OFF
It causes shutdowns.
2020-07-21 16:47:38 +02:00
Denis Efremov
e562dd8adf executor: fix build errors in setup_32bit_idt()
GCC10 fails to build the code with errors:
executor/common_kvm_amd64.h:143:64: error: ‘gate.kvm_segment::type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
executor/common_kvm_amd64.h:143:56: error: ‘gate.kvm_segment::base’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Replace 'case 6' with 'case 5' since 'i % 6' results in [0..5].

Signed-off-by: Denis Efremov <efremov@linux.com>
2020-07-21 13:04:43 +02:00
Anton Lindqvist
328906f3da sys/openbsd: break out rlimit
In the hopes of lowering the cyclomatic complexity.
2020-07-21 12:15:13 +02:00
Anton Lindqvist
0d540696af sys/openbsd: remove hardcoded constants 2020-07-21 12:15:13 +02:00
Anton Lindqvist
36f35f4714 sys/openbsd: neutralize sysctl kern.maxclusters
One of "no output from test machine" report causes[1]. Since it's a root
only knob, disallow fiddling with it for now.

[1] https://syzkaller.appspot.com/bug?id=a222a4193c0a9814e02fcc61b7343a5af04a7457
2020-07-21 12:15:13 +02:00
Tobias Klauser
d88894e677 Makefile: set GO111MODULE=off for go get in install_prerequisites
Otherwise the versions in go.mod are updated on running `make
install_prerequisites` leading to inconsistent vendoring errors:

go: inconsistent vendoring in /go/src/github.com/google/syzkaller:
	golang.org/x/net@v0.0.0-20200625001655-4c5254603344: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/tools@v0.0.0-20200717024301-6ddee64345a6: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/net@v0.0.0-20200520182314-0ba52f642ac2: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	golang.org/x/tools@v0.0.0-20200626171337-aa94e735be7f: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-07-20 17:03:33 +02:00
Albert van der Linde
4285ffa3fe sys/linux: add generated files 2020-07-20 11:30:15 +02:00