Commit Graph

5181 Commits

Author SHA1 Message Date
Dmitry Vyukov
860c4de9cf sys/linux: regenerate const files on next-20200609 2020-06-09 16:01:11 +02:00
Ricardo Cañuelo
ed70e69f00 sys/linux: v4l2 and vim2: update and add additional const files
Add missing const files for dev_video4linux_vim2m: 386, arm and
ppc64le).

Update dev_video4linux const files.
2020-06-09 15:58:40 +02:00
Ricardo Cañuelo
07fe0fb871 sys/linux: v4l2 and vim2m2 refactoring
Remove a single template parameter to v4l2_buffer, as it should always
use a fd_request descriptor. Update all syscalls that use it.

Refactor the VIDIOC_STREAMON and VIDIOC_STREAMOFF vim2m ioctls to use
v4l2_buf_type_vim2m as a parameter instead of an union.

Remove ioctl$VIDIOC_RESERVED from dev_video4linux.txt (not defined in
upstream kernel).
2020-06-09 15:58:40 +02:00
Ricardo Cañuelo
c5e085d96d sys/linux: specific descriptions for vim2m (v4l2)
Add a set of descriptions to focus the fuzzing process on the V4L2 vim2m
test driver. This should be useful to test the M2M framework.

The syscalls are based on a specific file descriptor for the vim2m
device and a selection of v4l2 ioctls that operate on it. Some of the
existing v4l2 data structure definitions have been extended to allow
restricting and selecting some options in order to narrow down the
fuzzing process.

Initial support for Request API added.
2020-06-09 15:58:40 +02:00
Dmitry Vyukov
092934c131 syz-fuzzer: log that we connected to manager
For debugging of connectivity issues.
2020-06-09 13:52:43 +02:00
Ricardo Cañuelo
0d60b78a51 docs: suggested changes for pull-request 1797
https://github.com/google/syzkaller/pull/1797
2020-06-08 22:21:43 +02:00
Ricardo Cañuelo
d6de733164 docs: more info about resources and the "enable_sysaclls" config option
- Give some extra clarifications and examples about resources in syscall
    descriptions.
  - More details about how to use the "enable_syscalls" option.
  - Mention pseudo-syscalls in the general syscall description doc file.
2020-06-08 22:21:43 +02:00
m00nbsd
7604bb0341
dashboard/config/netbsd: add fault(4) to the kernel build (#1795) 2020-06-08 11:59:03 +02:00
Dmitry Vyukov
7751efd04a prog: increase number of iterations in a test
The test is random and needs some large number of iterations to pass.
It failed for me after an unrelated change in descriptions.
So bump number of iterations.
2020-06-07 20:27:18 +02:00
Dmitry Vyukov
2c2b926cb7 .golangci.yml: reduce function line count from 200 to 140
140 lines should be enough for everyone.
2020-06-07 10:41:01 +02:00
Dmitry Vyukov
948dd3af44 prog: remove target.StringDictionary
The linux string dictionary comes from extremely old times
when we did not have proper descriptions for almost anything,
and the dictionary was a quick hack to guess at least some
special strings.
Now we have way better descriptions and the dictionary
become both unnecessary and probably even harmful.
2020-06-07 10:41:01 +02:00
Dmitry Vyukov
3f04838a10 .golangci.yml: make goconst checker more strict 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
cdf1aa4dc3 pkg/report: deduplicate code across netbsd and openbsd 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
21b79583f1 .golangci.yml: enable receiver name check for pkg/ast 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
70854cd639 .golangci.yml: enable lll for pkg/report/linux.go 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
0e2e52a87a .golangci.yml: reduce scope of suppressions
Reduce scope of some suppressions (some are violated only in some packages).
Remove some outdated, fix and enable the type switch warning.
2020-06-07 10:41:01 +02:00
Matt Morehouse
e6b89e4e5a sys/linux: add MREMAP_DONTUNMAP flag
Update https://github.com/google/syzkaller/issues/533.
2020-06-06 07:49:50 +02:00
Marco Vanotti
c3e9afb345 executor/fuchsia: Don't map memory as executable.
Fuchsia has strict controls over who can map memory as executable.
Refactoring syz-executor to be able to do that involves a non trivial
amount of work: it needs to run as a fuchsia component and replace stdin
for some other mechanism to communicate with syz-fuzzer (probably a fidl
service and a thin client that proxies stdin/stdout to syz-fuzzer via
ssh).

Mapping memory as executable doesn't seem to be used or needed in
syz-executor at all. After talking with Dmitry, he mentioned that it was
used in a deprecated feature: `syz_execute_func` which would execute
random code. It also allows more scenarios during fuzzing.

For now, I'm removing that option to allow syzkaller continue fuzzing.

This change also refactors all of the error messages adding a string
representation of the `zx_status_t` in error logs.
2020-06-05 16:46:48 -03:00
Matthew Dempsky
f243c88ffd sys/fuchsia: regenerate FIDL descriptions
This commit is the results of running:

  rm sys/fuchsia/*.const sys/fuchsia/*.syz.txt
  TARGETOS=fuchsia make extract
2020-06-05 15:08:57 -03:00
Matthew Dempsky
57a83e9453 sys/fuchsia: update "make extract" support code
FIDL fuzzing hasn't been working for a while, and it's further
bit-rotted as upstream FIDL functionality has continued to evolve.
This commit updates enough FIDL functionality to get a minimal FIDL
test case to work again.
2020-06-05 15:08:57 -03:00
Dmitry Vyukov
d36418e90b prog: increase number of itereations in TestRotationCoverage
It failed on CI once:
https://github.com/google/syzkaller/pull/1789/checks?check_run_id=740199305
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
48b44e1ce0 .golangci.yml: reenable dupl checker
At some point it was enabled, but then somehow got disabled.
Re-enable and fix some regressions.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
2b2857bd21 .golangci.yml: enable funlen checker
Checks for too long functions (based on lines and statements).
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
2fcb2b5c16 .golangci.yml: enable gocognit checker
Finds too complex functions.
Similar to gocyclo, but uses somewhat different metric.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
e3d77cf2a3 .golangci.yml: enable godot checker
A good one. Lots of fixed comments are contributed by episodic contributors.
So it's good to catch these earlier.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
26ae0a0edd .golangci.yml: enable goprintffuncname checker
Only 1 warning. Good to fix and enable before we get more.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
4ac8a30aa8 .golangci.yml: explicitly list disabled checkers
These are disabled by default, so this does not change behavior.
But it's good to see whole list and this makes it clear
that they are not missed accidentially.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
6c22a3d2dd .golangci.yml: enable nestif checker
Prevents functions with too many nested if's.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
503fd5b2f7 .golangci.yml: enable whitespace checker
Points to bad empty lines very precisely.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
555756280e pkg/compiler: remove unused statement 2020-06-05 12:23:19 +02:00
Dmitry Vyukov
1de720878f .github/workflows: support errors from golangci-lint
If there are compilation errors in tests, golangci-lint
produces then in the following format:

level=warning msg="[runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [/syzkaller/gopath/src/github.com/google/syzkaller/syz-fuzzer/mab_reward_test.go:26:35: cannot use rawCov (variable of type []float64) as float64 value in argument to status.Reward.RawAllTasks.Update /syzkaller/gopath/src/github.com/google/syzkaller/syz-fuzzer/mab_reward_test.go:26:43: cannot use rawTime (variable of type []float64) as float64 value in argument to status.Reward.RawAllTasks.Update /syzkaller/gopath/src/github.com/google/syzkaller/syz-fuzzer/mab_reward_test.go:27:38: cannot use totalReward (variable of type []float64) as float64 value in argument to status.Reward.RewardAllTasks.Update /syzkaller/gopath/src/github.com/google/syzkaller/syz-fuzzer/mab_reward_test.go:33:2: reward declared but not used]"

Transform this to github format.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
7c84a90501 .github/workflows: support errors without :column
Also transform:

file.go:line: error message

to the github format.
2020-06-05 12:23:19 +02:00
Andrey Konovalov
2420d1bcbc
Update setup.md 2020-06-04 21:02:02 +02:00
Andrey Konovalov
241440828e
Update setup.md 2020-06-04 21:01:10 +02:00
Michael Tuexen
6720fdefa0 docs/freebsd: install golangci-lint on FreeBSD
This is required for gmake presubmit.
2020-06-04 12:36:07 +02:00
Michael Tuexen
2bacf9b5a6 sys/freebsd: mark some fields as big endian 2020-06-04 12:35:47 +02:00
Dmitry Vyukov
1f837d8b35 pkg/report: improve "using smp_processor_id() in preemptible code" parsing 2020-06-04 12:16:25 +02:00
Matt Morehouse
b0d1c0d578 docs/linux: fix example qemu command 2020-06-04 02:49:18 +02:00
Dmitry Vyukov
a5ce5de0ae pkg/report: update "using X in preemptible code" bug 2020-06-03 12:46:37 +02:00
Dmitry Vyukov
e8d36083fd codecov.yml: tidy github comment format 2020-06-03 11:59:09 +02:00
Dmitry Vyukov
2ba71ec506 pkg/repro: don't enable features missing on the target
Manager has already checked what features are present on the target.
But if we detected that, say, USB is missing, we still enabled it
in the starting csource options. This is wrong, increases configuration
minimization time and may lead to some obscure bugs.
2020-06-03 11:35:08 +02:00
Matthew Dempsky
a86ce602b3 syz-runtest: disable csource tests for HostFuzzer targets
HostFuzzer targets require that we cross-compile the csource tests and
then copy them to the target system. The code to copy files is
currently missing from syz-runtest; also, at least for Fuchsia (which
uses HostFuzzer mode), cross-compiling is non-trivial.
2020-06-03 10:30:14 +02:00
Andrey Konovalov
66f8bb2026 dashboard, syz-ci: add blacklist for bisection results
Currently only ignores the commit that adds the Raw Gadget interface.

Requested here:
https://groups.google.com/g/syzkaller-bugs/c/sZUeGC3Fh-o/m/t_5cKPrMAQAJ
2020-06-03 10:24:14 +02:00
Matthew Dempsky
f3ba1b5b7b sys/syz-sysgen: add -src and -out flags
This is useful for integrating into Fuchsia's build system, where we
need to be able to run syz-sysgen with a read-only source directory,
and emit the output files elsewhere.
2020-06-02 10:29:24 -07:00
Dmitry Vyukov
06417ff868 pkg/report: add tests for rcu stalls in kmem_cache_alloc
I though maybe we need special handling for them:
stop at kmem_cache_alloc function. But now I am not sure.
This can also be an infinite loop which calls kmalloc/kfree.
Let's not change code for now, just fix things with tests
(this is a good representative set).
2020-06-02 17:47:56 +02:00
Andrey Konovalov
c98aaf984a pkg/report: improve report titles 2020-06-02 17:23:51 +02:00
Dmitry Vyukov
52fd7b7d77 tools: add syz-big-env
On top of syz-env it provides akaros/fuchsia/netbsd toolchains and gcloud sdk.
With this it's possible to run dashboard/app tests on CI and locally
and test executor build and pkg/{csource,cover} for these OSes.

Update #1765
2020-06-02 13:39:30 +02:00
Dmitry Vyukov
2b26ad000f pkg/cover: skip test on akaros
Akaros compiler does not support coverage.
2020-06-02 13:39:30 +02:00
Dmitry Vyukov
d56234396c pkg/cover: support coverage reports on fuchsia 2020-06-02 13:39:30 +02:00
Dmitry Vyukov
a0331e89e0
docs: fix a typo
Fixes ##1778
2020-05-31 10:23:36 +02:00