5162 Commits

Author SHA1 Message Date
Tobias Klauser
df01f6fc27 pkg/osutil: use functionality from x/sys/unix
Use unix.Unmount instead of manually wrapping SYS_UMOUNT2.

Use unix.IoctlSetPointerInt instead of manually wrapping SYS_IOCTL. This
also allows to use FS_IOC_SETFLAGS instead of manually defining it for
each GOARCH.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-29 13:34:06 +02:00
Tobias Klauser
344d949f1e vendor: bump golang.org/x/sys/unix
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-29 13:34:06 +02:00
Necip Fazil Yildiran
9befc2b603
executor: enable cgroup/cpuset memory pressure calc. (#1879)
Enable the cpuset.memory_pressure_enabled flag in the root cpuset.

Co-authored-by: Necip Fazil Yildiran <necip@google.com>
2020-06-29 12:27:09 +02:00
Necip Fazil Yildiran
3ff434cc0a executor: enable cgroup/cpuset memory pressure calc.
Enable the cpuset.memory_pressure_enabled flag in the root cpuset.
2020-06-29 11:07:03 +02:00
Dmitry Vyukov
0375051c14 pkg/host: increase executor setup timeout
For context see:
https://groups.google.com/d/msg/syzkaller/7yOtIJGW2sw/Siw8mtu0CAAJ
2020-06-29 07:13:19 +02:00
m00nbsd
a2cdad9d42
executor/netbsd: base nth on 2 (#1874) 2020-06-27 17:24:37 +02:00
Tobias Klauser
2defc703fd docs/linux: add setup guide for riscv64 kernel in QEMU
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-27 15:04:27 +02:00
Tobias Klauser
f5b2c665da vm/qemu: add support for linux/riscv64
Since the qemu riscv64 port does not work with the default -net nic
parameter, add support to use in the modern way of specifying network devices
to qemu, i.e. -device virtio-net-device,netdev=0 -netdev user,id=net0,host=...

The same applies for the -hda qemu option. Provide a way to use the
modern way of specifying image devices as well.

Other/new ports may use these options as well in the future by setting
UseNewQemuNetOptions and/or UseNewQemuImageOptions.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-27 15:04:27 +02:00
Tobias Klauser
032b42395f sys/linux: generate fsinfo description for riscv64
PR #1856 added the fsinfo description before support for linux/riscv64
was added through PR #1867.

Re-generate the description so fsinfo is covered on linux/riscv64 as
well.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-27 10:14:25 +02:00
Ayushi Sharma
ffec44b5d1
Adding stat(2) and statfs(2) related syscalls (#1855)
* sys/netbsd: adding filesystem and communication syscalls

* sys/netbsd: add fix for struct sockaddr_storage and profil(2)

* sys/netbsd: add common ioctl(2) commands

* sys/netbsd: resolving conflicts

* sys/netbsd: adding stat() and statfs() related syscalls

* sys/netbsd: adding missing flags for getfsstat(2)

Co-authored-by: Siddharth M <siddharth.muralee@gmail.com>
2020-06-26 13:26:51 -07:00
Jiaheng Hu
4b0871d90d sys/linux: add description for fsinfo
Added the description for the new fsinfo sys call (currently in
linux-next). Details about fsinfo can be seen in
https://lkml.kernel.org/linux-fsdevel/158454408854.2864823.5910520544515668590.stgit@warthog.procyon.org.uk/.
2020-06-26 11:31:35 -07:00
Dmitry Vyukov
349959fbca tools/syz-check: support all arches 2020-06-26 17:34:52 +02:00
Tobias Klauser
9506ea6dcf pkg/host: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
30c61a8438 vm/vmimpl: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
6050b932e6 Makefile: add support for linux/riscv64
Install g++-riscv64-linux-gnu in install_prerequisites target and hook
up arch_linux_riscv64_target.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
1cbaafd119 executor: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
999d3ea4e0 sys/linux: add initial support for riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
a8829ad274 pkg/cover: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
9a9f703898 pkg/osutil: implement support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
bf9f00404e sys/targets: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
a7c0649868 sys/syz-sysgen: ignore *_kvm.txt on linux/riscv64
The Linux RISC-V port in linux-next doesn't support KVM yet. Ignore it
for now until KVM support is added upstream.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
42306a435d sys/syz-extract: ignore *_kvm.txt on linux/riscv64
The Linux RISC-V port in linux-next doesn't support KVM yet. Ignore it
for now until KVM support is added upstream.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Alexander Egorenkov
b202c7a8a2 pkg/csource: fix casting of parameters for trampolines
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-26 12:01:33 +02:00
Alexander Egorenkov
aea82c003a sys/linux: first 64bit big-endian architecture s390x
* mmap syscall is special on Linux s390x because
  the parameters for this syscall are passed as a struct
  on user stack instead of registers.
* Introduce the SyscallTrampolines table into targets.Target
  to address the above problem.
* There is a bug in Linux kernel s390x which causes QEMU TCG
  to hang when KASAN is enabled. The bug has been fixed
  in the forthcoming Linux 5.8 version. Until then do not enable
  KASAN when using QEMU TCG, QEMU KVM shall have no problems with
  KASAN.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-25 23:08:45 +02:00
Dmitry Vyukov
f9147b0836 executor: don't use static_assert
Use existing way of doing size checks, otherwise akaros build is broken:
https://github.com/google/syzkaller/pull/1868/checks?check_run_id=808613616
2020-06-25 21:29:13 +02:00
Alexander Egorenkov
ac40b8cc84 executor: fix write_output_64
The output pointer was not updated after writing.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-25 21:14:42 +02:00
Dmitry Vyukov
adb7d9e67b tools/docker/env: add s390x and riscv64 toolchains
These arches are in-progress now. Need them in the image.
2020-06-25 19:27:01 +02:00
Tobias Klauser
d01fc6f500 prog: add support for riscv64
This will allow to run `make TARGETVMARCH=riscv64`.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-25 18:35:04 +02:00
Necip Fazil Yildiran
c7b4497a9d sys/linux: documented the findings on qrtr rpmsg and mhi drivers
The QRTR rpmsg and mhi interfaces are not tested at this time.
The reasoning is documented for future reference in the corresponding
descriptions file.
2020-06-25 11:44:18 +02:00
Jiaheng Hu
9d60b18e94 sys/linux: add openat2 description
Added the openat2 syscall for file and for directory. Details of the
syscall can be seen at
https://man7.org/linux/man-pages/man2/openat2.2.html.
2020-06-24 12:08:15 -07:00
Dmitry Vyukov
41694dbf71
docs: fix a link in research page 2020-06-24 12:06:50 +02:00
Alexander Egorenkov
bbad15ae75 target: support of big-endian architectures
* 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>
2020-06-23 21:24:30 +02:00
Danielle Ratson
6930bbef3b sys/linux: Add port and sb devlink syscalls
Add support for set of devlink port and sb interface syscalls.

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
2020-06-23 17:57:38 +02:00
Dmitry Vyukov
2528093954 sys/targets: fix mknod neutralize for netbsd
mknod on netbsd can now also accept a resource for the last arg.
Fix that and add a test that will catch such things more reliably.
2020-06-23 16:54:07 +02:00
Dmitry Vyukov
b1b6c0ed6d dashboard/app: use DailyLimit=0 to mark disabled reportings
We currently use ConstFilter(FilterHold) to mark disabled reportings.
But this condition is impossible to check (even if we make it a named
function, functions are not comparable).
Use DailyLimit=0 as a way to say the same. Note: previously it was used to say "no limit".
This is needed for the next change that needs to understand the active last reporting.
2020-06-23 16:42:46 +02:00
Dmitry Vyukov
854773ea9f dashboard/app: prohibit dup cycles
Bug dup cycles are not useful and the
rest of the code is not prepared for them.
Prohibit updates that create cycles.
This required to restructure the code to move
the check into the transaction, so that we
can't get cycles even after concurrent updates.

Fixes #1852
2020-06-23 16:42:46 +02:00
Dmitry Vyukov
8e0c064ef4 prog: simplify execContext.write 2020-06-23 16:21:51 +02:00
Alexander Egorenkov
e5d10a4327 ipc: fix endianness issues
Use native byte-order for IPC and program serialization.
This way we will be able to support both little- and big-endian
architectures.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-23 16:18:44 +02:00
Necip Fazil Yildiran
54566aff16 sys/linux: add descriptions for qrtr-tun 2020-06-23 10:34:37 +02:00
Necip Fazil Yildiran
39240c9e93 sys/linux/socket_qipcrtr: enhance desc for qipcrtr
Utilization of special values for port and node ids.
Added desc for sendmsg and recvmsg.
2020-06-23 10:34:37 +02:00
Necip Fazil Yildiran
0c8fbbfce1 sys/linux: add descriptions for qrtr socket
Added descriptions to test Qualcomm's IPC router protocol for sockets.
Update #533.
2020-06-23 10:34:37 +02:00
Necip Fazil Yildiran
125d86d101 CONTRIBUTORS: add Necip Fazil Yildiran 2020-06-23 10:34:37 +02:00
Jukka Kaartinen
1afe15356a tools/syz-reporter: Tool to share/visualize crashes
Goes through crash folder that is stated in the workdir.
Collects the crashes, counts and tags.

usage:
 ./bin/syz-reporter -config manager.cfg

Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
2020-06-22 15:10:31 +02:00
Marco Elver
9843a4a88c docs/syzbot: Add link to GCC 10 2020-06-22 15:09:21 +02:00
Alexander Egorenkov
c446449414 prog/encodingexec: pad data args with zero bytes
We must pad data arguments with known values when serializing
them into the given destination buffer because it could
be reused and contain random bytes from previous use.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-22 13:34:25 +02:00
Ayushi Sharma
eabcced432
sys/netbsd: add common ioctl() commands (#1850)
* sys/netbsd: adding filesystem and communication syscalls

* sys/netbsd: add fix for struct sockaddr_storage and profil(2)

* sys/netbsd: add common ioctl(2) commands

* sys/netbsd: resolving conflicts

Co-authored-by: Siddharth M <siddharth.muralee@gmail.com>
2020-06-21 10:00:43 -07:00
Michael Tuexen
9529a48126 sys/freebsd: update SCTP related socket options for FreeBSD
For implementing sctp_bindx(), FreeBSD uses two IPPROTO_SCTP
level socket options SCTP_BINDX_ADD_ADDR and SCTP_BINDX_REM_ADDR.
The type of the value was changed from struct sctp_getaddresses *
to struct sockaddr_in * or struct sockaddr_in6 * in
https://svnweb.freebsd.org/changeset/base/362451
2020-06-21 12:54:51 -04:00
Ayushi Sharma
4f2acff939
sys/netbsd: increase syscall support (#1805)
* sys/netbsd: increase syscall support

* sys/netbsd: increase syscall support fixed

* sys/netbsd: fixed mknod issue

* sys/netbsd: add fix for getdents, futimes and setpriority
2020-06-21 01:41:23 -07:00
Alexander Egorenkov
c655ec77ca executor: fix endianness problem in internet checksum
csum_inet_update does not handle odd number of bytes
on big-endian architectures correctly. When calculating
the checksum of odd number of bytes, the last byte must be
interpreted as LSB on little-endian architectures and
as MSB on big-endian ones in a 16-bit half-word.

Futhermore, the checksum tests assume that the underlying architecture
is always little-endian. When a little-endian machine stores
a calculated checksum into memory, then the checksum's bytes
are automatically swapped. But this is NOT true on a big-endian
architecture.

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-06-19 20:49:11 +02:00
Andrey Konovalov
81abc33188
Update external_fuzzing_usb.md 2020-06-19 19:10:56 +02:00