Commit Graph

5181 Commits

Author SHA1 Message Date
Dmitry Vyukov
8531773447 pkg/bisect: move checking of minimized config into common code
That part is not linux-specific, move it to the common code.
The more code we have in the common code, the more code we can test.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
63b5e2d7d2 pkg/bisect: don't overwrite user configuration
We don't own this object and should not touch,
it may be unexpected by the caller and may cause data races.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
a1f1bc47d3 pkg/bisect: test resulting config
One of main outputs of the config minimization is the new config,
but tests don't do any single check of it.
Check the resulting config (is it correct in all cases?).
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
e8fcf811ec pkg/bisect: don't ignore errors during config minimization
Ignoring errors is bad. It leads to silent failures.
If there is some particular error condition that is expected
to happen and we want to ignore, we need to ignore that one only
rather than all potenital errors in the whole process.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
1640a9d528 pkg/bisect: minor style fix ups 2020-07-02 10:56:05 +02:00
Dmitry Vyukov
31792dba46 pkg/bisect: fix crash when all releases are broken
Currently we crash with nil deref in this special case.
2020-07-02 10:56:05 +02:00
Jouni Hogander
f8885dc4ce pkg/bisect: Implement config bisection
Implement Linux kernel configuration bisection. Use bisected minimalistic
configuration in commit bisection. Utilizes config_bisect.pl script from Linux
kernel tree in bisection.

Modify syz-bisect to read in kernel.baseline_config. This is used as a "good"
configuration when bisection is run.
2020-07-02 09:32:57 +02:00
Jukka Kaartinen
d42301aa2f Pass baseline config around
Add new new Syzkaller configuration option kernel_baseline_config. This option
is supposed to be used by kernel configruation bisection as a "good" config"

Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
Signed-off-by: Jouni Hogander <jouni.hogander@unikie.com>
2020-07-02 09:32:57 +02:00
Dmitry Vyukov
bed103955b codecov.yml: suppress coverage errors even more
We are still getting nacks from codecov on PRs after the previous commit.
Try to add patch section to prevent failures.
2020-07-01 22:57:25 +02:00
Tobias Klauser
695ef2ddb2 docs/linux: use OpenSBI instead of BBL to boot linux/riscv64 QEMU VM
OpenSBI seems to be the recommended boot method nowadays, see e.g. [1],
[2]

[1] https://riscv.org/2019/01/risc-v-community-releases-opensbi-to-foster-continued-ecosystem-growth/
[2] https://wiki.freebsd.org/riscv#OpenSBI

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-07-01 21:29:39 +02:00
Dmitry Vyukov
39acb39de2 codecov.yml: suppress coverage errors more
Somehow informational:true is not enough to not produce errors.
We are constantly getting nacks on PRs like:
  x codecov/patch — 59.2% of diff hit (target 65.3%)
Add back and relax target and treshold.
2020-07-01 13:55:27 +02:00
Dmitry Vyukov
090d8f7bdf sys/linux: add riscv_flush_icache syscall
+extract constants on next-20200701
2020-07-01 10:57:23 +02:00
Tobias Klauser
33576216a5 docs/linux: mention CONFIG_KMEMLEAK in suggested kernel configs
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-07-01 10:43:09 +02:00
Anton Lindqvist
c0383ebe66 sys/openbsd: add missing wskbd ioctl descriptions 2020-06-30 21:08:59 +02:00
Jiaheng Hu
917afeaa70 sys/linux: add faccessat2
Added the faccessat2 description (linux 5.8) (https://git.kernel.org/linus/c8ffd8bcdd28296a).
2020-06-29 13:44:45 -07:00
Anton Lindqvist
cc1e9bc12d sys/openbsd: neutralize yet another pf ioctl command
Disarms the latest reproducer[1] for the discovered "no output from test
machine" panic.

While here, tidy up and improve comments.

[1] https://syzkaller.appspot.com/bug?id=4c3b1ac22d6d7f1d9ebcad5469a28cb4562debda
2020-06-29 21:36:27 +02:00
Dmitry Vyukov
ce9ef6f2ec docs/linux: change suggested kernel git repo
Suggest to checkout linux kernel from kernel.org rather than from github.
github is a mirror and we don't use it ourselves and I think it's
generally not used by kernel developers. The kernel.org repo is
the canonical location.
2020-06-29 15:28:14 +02:00
Andrey Konovalov
708d6e5be1
Update setup_ubuntu-host_qemu-vm_x86-64-kernel.md 2020-06-29 15:05:07 +02:00
Andrey Konovalov
54cbc73031
Update setup_ubuntu-host_qemu-vm_x86-64-kernel.md 2020-06-29 15:00:45 +02:00
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