Commit Graph

5523 Commits

Author SHA1 Message Date
Necip Fazil Yildiran
cc59e7e4ad sys/linux: use per-field directions in descriptions 2020-08-13 13:50:25 +02:00
Necip Fazil Yildiran
f5442bde55 pkg, prog: add per-field direction attribute 2020-08-13 13:50:25 +02:00
Tetsuo Handa
ee7cb8b695 Makefile: try to install clang-tidy package explicitly
Commit 43f1389ddc ("Makefile: enable clang-tidy in presubmit tests")
added clang-tidy to only tools/docker/env/Dockerfile file. We should try to
explicitly install clang-tidy in Makefile for those who don't use docker.

  /bin/sh: 1: clang-tidy: not found
  (...snipped...)
  Makefile:250: recipe for target 'tidy' failed
  make[2]: *** [tidy] Error 127
  make[2]: *** Waiting for unfinished jobs....
  (...snipped...)
  Makefile:269: recipe for target 'presubmit_smoke' failed
  make[1]: *** [presubmit_smoke] Error 2
  Makefile:264: recipe for target 'presubmit' failed
  make: *** [presubmit] Error 2
2020-08-13 13:26:55 +02:00
Tetsuo Handa
bc15f7dbbc executor/linux: dump mount information when failed to open kcov file
There are many "lost connection to test machine (5)" reports where the
testing terminated due to ENOENT upon open("/sys/kernel/debug/kcov").

Since some testcase might be unintendedly modifying mount information,
let's start from checking whether/how mount is broken.
This commit might be reverted after the cause is identified and fixed.
2020-08-12 18:19:04 +02:00
Mark Johnston
1bf9153625 pkg/runtest: re-enable 32-bit test target tests on FreeBSD
They now pass since we set DataOffset correctly for those targets.
This reverts 594e57536f.
2020-08-12 18:09:10 +02:00
Mark Johnston
b38f46a018 sys/targets: override DataOffset for 32-bit test targets on FreeBSD
freebsd/386 requires a non-default DataOffset value.  Since it is
currently the only platform with this constraint, just add a special
case for that when initializing target parameters.
2020-08-12 18:09:10 +02:00
Dmitry Vyukov
0d7bd2e052 executor: initialize vhci early
We added initialize_vhci to all sandboxes so that we don't have
unused function warnings. We assumed it will fail silently,
but it fails loudly and crashes the whole machine on init,
so no fuzzing can happen with sandboxes other than none.
Initialize vhci earlier while we still have CAP_ADMIN.
As a nice side effect we now don't need to use syz_init_net_socket.
2020-08-12 11:03:32 +02:00
Mark Johnston
bb3e5fe608 docs/freebsd: clarify that the dataset name is an example 2020-08-11 11:42:07 -04:00
Mark Johnston
4ad44804fb docs/freebsd: update the "missing things" list
Some items have already been implemented.  Add some new items to work
towards.
2020-08-11 11:42:07 -04:00
Anton Lindqvist
5d3ebca921 executor: enable extra coverage on OpenBSD
This reverts commit 63a7334112.
2020-08-11 10:56:29 +02:00
Dmitry Vyukov
bacaf5fa2c pkg/report: fix parsing of kernel-usb-infoleak
It used to use warningStackFmt, it is wrong, this is not a WARNING.
As the result it previously parsed as:
KMSAN: kernel-usb-infoleak in __kmalloc
2020-08-11 09:58:05 +02:00
Ioana-Ruxandra Stăncioi
d3694ffbb1 sys/linux: add tca_flower_key_mpls_opts descritpion
mpls_opts:
https://elixir.bootlin.com/linux/v5.8-rc4/source/net/sched/cls_flower.c#L670
mpls_opts_lse:
https://elixir.bootlin.com/linux/v5.8-rc4/source/net/sched/cls_flower.c#L731
2020-08-10 17:55:15 +02:00
Dmitry Vyukov
83223b4c46 pkg/csource: add description of the generation process 2020-08-10 15:32:40 +02:00
zizizi
7adc7b652a sys/linux: fix make extract on latest linux-next
VIRTIO_F_IOMMU_PLATFORM was renamed to VIRTIO_F_ACCESS_PLATFORM
2020-08-10 12:06:25 +02:00
zizizi
140970f4be CONTRIBUTORS: add Matthew Halchyshak 2020-08-10 12:06:25 +02:00
Alexander Egorenkov
70301872e1 syz-manager/cover: support compiler triple for readelf 2020-08-09 14:58:49 +02:00
Albert van der Linde
f721e4a097 sys/linux: add missing flags to rtnexthop 2020-08-08 14:12:06 +02:00
Albert van der Linde
cb9c120a74 sys/linux: add descriptions for RTM_(NEW|DEL|GET)NEXTHOP
https://elixir.bootlin.com/linux/v5.8-rc4/source/net/ipv4/nexthop.c#L1961
2020-08-08 14:12:06 +02:00
Mark Johnston
01975a06cb executor: always ignore SIGBUS on FreeBSD
syz-executor uses a heuristic to help fail closed if an invalid access
might corrupt the output region.  This heuristic fails on FreeBSD, where
SIGBUS is delievered with si_addr equal to address of the faulting
instruction, rather than 0 when the fault address cannot be determined
(e.g., an amd64 protection fault).  Always handle SIGBUS quietly on
FreeBSD.

This fixes pkg/runtest tests for sys/test/test/nonfailing.
2020-08-08 11:09:48 +02:00
Mark Johnston
594e57536f pkg/runtest: disable 32-bit tests on FreeBSD for now
FreeBSD requires a non-default SYZ_DATA_OFFSET on 32-bit targets.
2020-08-08 11:09:48 +02:00
Mark Johnston
6ba54cf64e executor: use MAP_EXCL to map the data region on FreeBSD
We've had some problems where the default SYZ_DATA_OFFSET collides with
a mapping created by the C runtime.  MAP_EXCL ensures that mmap() will
fail in this case, so such problems become a bit easier to diagnose.
2020-08-08 11:09:48 +02:00
Dmitry Vyukov
ff51e5229e tools/syz-hubtool: fix up drain mode
We may want to drain hub without uploading any repros/corpus.
2020-08-07 18:39:45 +02:00
Dmitry Vyukov
bb468f3218 tools/syz-hubtool: add initial version
syz-hubtool uploads local reproducers to syz-hub.
2020-08-07 17:27:03 +02:00
Cheng-Min Chiang
28ac5c9e93 sys/linux/test: fix io_uring test
Fix the io_uring test by adding some blank lines after comments. This
commit changes nothing beside that.
2020-08-07 09:44:43 +02:00
Dmitry Vyukov
8115b1e225 dashboard/config: enable BPF LSM 2020-08-07 09:28:35 +02:00
Cheng-Min Chiang
20a3465b97 sys/linux: add descriptions for BPF LSM
This commit includes the following changes:
* executor: add a new syz_btf_id_by_name psuedo-syscall
* sys/linux: add descriptions for BPF LSM subsystem
* sys/linux: add instructions on how to dump vmlinux and install
  bpftool
* sys/linux/test: add tests for the new psuedo-syscall
* pkg/host: add support detection for the new psuedo-syscall
* pkg/runtest: skip the coverage test when invoking the new
  psuedo-syscall

Update #533.
2020-08-07 09:28:26 +02:00
Dmitry Vyukov
cb436c69d9 executor: add some code style checks
Move the test from pkg/csource to executor/
in order to be able to (1) run it on *.cc files,
(2) run on unprocessed *.h files, (3) produce line numbers.
Add a check for missed space after //.
2020-08-06 15:27:41 +02:00
Dmitry Vyukov
56fe566546 dashboard/config: enable rcupdate.rcu_expedited
See https://bugzilla.kernel.org/show_bug.cgi?id=208299
and https://groups.google.com/forum/#!topic/kasan-dev/si9jMcgTr74
for context.
2020-08-06 15:23:05 +02:00
Anton Lindqvist
1f122f880f pkg/report: fix uvm_fault report detection on OpenBSD
Regression introduced in commit cb93dc6a ("pkg/report: flag short
uvm_fault reports as corrupted") causing some valid reports to be
flagged as corrupted.
2020-08-06 12:02:42 +02:00
Dmitry Vyukov
4ca1c0ea44 tools/check-commits.sh: use PR head instead of base
Base points to already commetted changes,
we really want to cheack head of the PR.
2020-08-06 11:49:45 +02:00
Marco Elver
f94b533a4b tools/check-commits: allow canonical 'git revert' format
Allow the canonical 'git revert' format.
2020-08-06 11:49:26 +02:00
Marco Elver
0487ea6f5d Revert "dashboard/config: select KCSAN_VERBOSE in KCSAN config"
This reverts commit 02034dac31.

It seems that the new IRQ state tracking code that just landed in the
kernel breaks KCSAN more severely than I thought. Let disable lockdep
with KCSAN again until it is properly fixed.
2020-08-05 20:28:18 +02:00
Marco Elver
e72ba13c6e Revert "dashboard/config: disable PARAVIRT_DEBUG with KCSAN"
This reverts commit c9cef45b35.
2020-08-05 20:28:18 +02:00
Andy Nguyen
9969d2164d sys/linux: add HCI_COMMAND_PKT descriptions 2020-08-05 20:13:16 +02:00
Marco Elver
c9cef45b35 dashboard/config: disable PARAVIRT_DEBUG with KCSAN
Disable CONFIG_PARAVIRT_DEBUG, as it breaks lockdep+KCSAN right now.
2020-08-05 18:33:41 +02:00
Anton Lindqvist
2cea8f1f89 sys/openbsd: neutralize clock_settime
One of "no output from test machine" report causes[1].

[1] https://syzkaller.appspot.com/text?tag=ReproSyz&x=10b0c7d8900000
2020-08-05 15:05:15 +02:00
Dmitry Vyukov
b712935571 tools/check-commits.sh: fix commit range detection
We currently check from github.event.pull_request.base.sha
to github.event.pull_request.head.sha, but they may be in
different branches if the PR commits are branched not from
the latest master HEAD (at the time of PR creation).
Then GH will create a merge commit, and the range we try
to check is not valid.

Check github.event.pull_request.commits commits backwards
from github.event.pull_request.head.sha commit.
2020-08-05 09:18:56 +02:00
Stefano Duo
09121a7396 pkg/host/syscalls_linux.go: refactor isSupportedSyzkall()
Use a map: (string => func) instead of a switch for pseudo-syscalls
names. This reduces isSupportedSyzkall() cyclomatic complexity and
makes the linter happy.
2020-08-05 08:59:53 +02:00
Stefano Duo
06f8f7fbcd CONTRIBUTORS: add Stefano Duo 2020-08-05 08:59:53 +02:00
Marco Elver
02034dac31 dashboard/config: select KCSAN_VERBOSE in KCSAN config
In the KCSAN config, enable KCSAN_VERBOSE to generate better reports,
that include the locks held and the IRQ trace events for each thread.

The option requires PROVE_LOCKING, which comes with some performance
cost.
2020-08-04 21:39:55 +02:00
Dmitry Vyukov
43f1389ddc Makefile: enable clang-tidy in presubmit tests
Fix all errors it points to.
The one in netlink_send_ext is concerning.
2020-08-04 16:54:02 +02:00
Dmitry Vyukov
1089015fcc executor: remove block comments
1. We don't generally use /* */ block comments,
few precedents we have are inconsistent with the rest of the code.

2. pkg/csource does not strip them from the resulting code.

Remove the cases we have and add a test to prevent new ones being added.
2020-08-04 16:53:31 +02:00
Dmitry Vyukov
5ed76afa81 pkg/compiler: check for unused resources
If a resource is never used as an input, it is not useful.
It's effectively the same as using an integer.
Detect such cases, they are quite confusing.
Fix all existing errors in descriptions.
This uncovered some interesting bugs as well,
e.g. use of a completely unrelated fd subtype after copy-paste
(while the resource that was supposed to be used there is completely unused).
2020-08-04 16:53:16 +02:00
Dmitry Vyukov
80a0690249 dashboard/config: regenerate all configs
KASAN config generated on linux-next/next-20200731.
KMSAN config generated on kmsan/93f54a72361aebdc29d5756cd77b9278a08d9861.
KCSAN config generated on upstream/v5.8-rc7.
USB config generated on usb/e3ee0e740c3887d2293e8d54a8707218d70d86ca.

In preparation for config system refactoring,
to minimize diffs and make them more meaningful.
Also to make used kernel tree revisions known.
2020-08-04 10:58:43 +02:00
Andy Nguyen
196277c403 sys/linux/l2cap.txt: no array for l2cap_cid_le_signaling 2020-08-02 19:34:27 +02:00
Andy Nguyen
2c26f576ae all: fake hci le conn using handle 201 2020-08-02 19:34:27 +02:00
Dmitry Vyukov
55a879802a sys/linux: add more HCI_EV_CMD_COMPLETE types 2020-08-02 13:25:08 +02:00
Dmitry Vyukov
cb435b0c8a sys/linux: refine some l2cap flags 2020-08-02 12:49:26 +02:00
Andy Nguyen
cfd7c91a0a sys/linux: add l2cap_conf_opt options 2020-08-02 11:49:48 +02:00
Anton Lindqvist
63a7334112 Revert "executor: enable extra coverage on OpenBSD"
Forgot that the build machine must be updated with a newer OpenBSD
snapshot first in order to make the new kcov stuff available.

This reverts commit 96dd36234d.
2020-08-02 08:56:44 +02:00