Commit Graph

3978 Commits

Author SHA1 Message Date
Dmitry Vyukov
7c7ded697e prog: fix out-of-bounds access
ParseLog can access data out-of-bounds.
Fix that and fix regression fuzz tests to catch this.
2019-07-30 19:33:02 +02:00
Dmitry Vyukov
3b37734422 pkg/ast: fix out-of-bounds access
Scanner can access data out of bounds on bad input.
Also fix regression fuzz test to be able to detect the bug.
2019-07-30 18:43:14 +02:00
Dmitry Vyukov
314ea0c952 pkg/compiler: refactor regression fuzz test
Reuse most of the existing Fuzz function
rather than duplicate the logic.
2019-07-30 18:38:35 +02:00
Dmitry Vyukov
6b499767f1 dashboard/app: add index for fix bisection 2019-07-30 16:54:57 +02:00
Zubin Mithra
5894f4562d dashboard/app: allow the dashboard to create BisectFix jobs
* Modify createBisectJob() to retrieve bugs that are potential candidates for both
BisectCause and BisectFix.
* Modify TestBisectCause() to account for BisectFix jobs that are
returned when polling.
* Add TestBisectFixJob() to check that BisectFix jobs are returned only
after 30 days of reporting.
* pollCompletedJobs() is currently called to fetch finished bisection
jobs for reporting purposes. Modify it to not return BisectFix jobs so
that they are not reported.
2019-07-30 16:35:15 +02:00
Andrey Konovalov
be5344d300
Update syzbot.md 2019-07-30 16:31:04 +02:00
Dmitry Vyukov
30465d6f98 fuzzit.sh: go get go-fuzz-build
The build failed with:
./fuzzit.sh: line 13: go-fuzz-build: command not found
Though we go get it in make presubmit. Perhaps, local files
are not shared between jobs or something. Let's try to get get
right in fuzzit.sh.
2019-07-30 16:16:41 +02:00
Dmitry Vyukov
efe659d763 travis: add fuzzit.dev support
Based on https://github.com/fuzzitdev/example-go
Let's see if it works...
2019-07-30 14:13:44 +02:00
Andrey Konovalov
9ad042d8ec
Update syzbot.md 2019-07-30 13:58:44 +02:00
Hangbin Liu
f28bf2a5db sys/linux/socket.txt: update timestamp options
Update socket timeval, timestamp options and flags.

v2: separate SO_{TIMESTAMP, TIMESTAMPNS}_{OLD, NEW} as they only need
enable/disable option value.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2019-07-30 09:28:49 +02:00
Andrey Konovalov
f67095eefa
Update syzbot.md 2019-07-29 15:22:36 +02:00
Dmitry Vyukov
c85e1c5be9 pkg/cover: hierarchical coverage reports
Better coverage reports with hierarchical coverage information,
number of programs covering each line,
handling of partially covered lines,
links to programs covering lines.

Fixes #682
2019-07-26 19:32:14 +02:00
Andrey Konovalov
8fe30d3e86
Update syscall_descriptions.md 2019-07-26 15:03:41 +02:00
Dmitry Vyukov
3e5d1beb82 prog: fix crash in blob mutation
If we deserialized a huge blob (larger than max blob size),
then we can get a negative size in the "Insert random bytes" case at:

		if r := int(maxLen) - len(data); n > r {
			n = r
		}

Don't insert bytes if data is already larger than maxLen.
2019-07-26 10:43:08 +02:00
Dmitry Vyukov
cf49ed5769 prog: don't minimize ProcType to 0
Default value for ProcType is 0 (same for all PID's).
Usually 0 either does not make sense at all or make different PIDs collide
(since we use ProcType to separate value ranges for different PIDs).
So don't change ProcType to 0 unless the type is explicitly marked as opt
(in that case we will also generate 0 anyway).
2019-07-26 10:29:36 +02:00
VeronicaRadu
091bb0070f sys/linux: add usbmon add vfio descriptions 2019-07-26 09:07:19 +02:00
Dmitry Vyukov
732bc5a0a4 dashboard/app: ensure that tests consume all external reports
Ensure that tests consume all external reports as we already do for emails.
Reports is the most important thing because they involve people,
so tests need to be explicit and we want to notice changes in any reporting.
2019-07-25 16:31:25 +02:00
Dmitry Vyukov
0d7a12498b .gometalinter.json: delete
We don't use gometalinter anymore.
2019-07-25 15:11:30 +02:00
Dmitry Vyukov
8821159f77 dashboard/config: update upstream-kasan.config
Update config to 5.3.0-rc1.
Enable some new networking configs which should be able to reach.
Enable CONFIG_USB_DUMMY_HCD for /dev/usbmon testing.
2019-07-25 15:11:30 +02:00
Andrey Konovalov
32329ceb4b sys/linux: fix USB runtest 2019-07-24 10:38:36 +02:00
Dmitry Vyukov
de453f342b pkg/csource: skip cross-builds that are doomed to fail
OpenBSD instance failed with:

--- FAIL: TestSysTests (12.50s)
    --- FAIL: TestSysTests/linux/386 (0.16s)
        csource_test.go:145: failed to generate C source for ../../sys/linux/test/binder: cpp failed: exec: "cant-build-linux-on-openbsd": executable file not found in $PATH
...

Skip unsupported cross-builds in TestSysTests.
2019-07-23 10:01:44 +02:00
Dmitry Vyukov
78f30a5156 pkg/report: fix linux path prefix trimming
After f613a7c4 ("pkg/cover: fix prefix computation") we stopped trimming
starting "/" from linux path names. This broke get_maintainers.pl script
which is now given non-existent absolute paths (e.g. "/mm/mmap.c"),
as the result syzbot can't find any maintainers for bug reports
and mails them into lkml limbo.

Trim starting slashes and dots. Extend tests for catch this.
2019-07-23 09:24:09 +02:00
Dmitry Vyukov
d9ec038e02 pkg/report: refactor argument passing
We now pass 5 arguments through a bunch of functions,
this is quite inconvinient when the set of arguments changes.
Incapsulate all arguments in a struct and pass/store it as a whole.
2019-07-23 09:15:43 +02:00
Dmitry Vyukov
b858e6fb5f
dashboard/app: add test instructions 2019-07-23 08:56:16 +02:00
Andrei Vagin
bb071d588d vm/gvisor: run runsc with the alsologtostderr option
$ runsc -h
...
  -alsologtostderr=false: send log messages to stderr
...

Now gvisor doesn't send log messages on stderr by default,
and if we want to see these messages, we need to specify the
alsologtostderr option.
2019-07-23 08:47:25 +02:00
Marco Vanotti
f171a40c6b pkg/build: change gcc for clang in fuchsia
Recently fuchsia changed the default compiler from GCC to clang. This
change updates the paths in the build package.
2019-07-23 08:44:20 +02:00
Marco Vanotti
1b0aeaa4e8 Makefile: build fuchsia go binaries using the sdk
This commit removes a dependency on fuchsia's tools/devshell/contrib/go,
which was removed recently[0].

Now to build go binaries for fuchsia we are not relying on the
fuchsia.git repo at all. The code just needs a copy of the fuchsia
//third_party/go repository, the fuchsia sdk and a copy of clang.

Users should download the sdk and clang beforehand (see documentation
for links), and then run (with the correct environment variables):

```
$ make TARGETOS=fuchsia TARGETARCH=amd64 \
    SOURCEDIR=$HOME/fuchsia \
    FX_SDK_PATH=${HOME}/sdk/fuchsia-sdk \
    CLANG_PATH=${HOME}/sdk/clang \
    fuchsia_go
```

After that, they will be able to build the syzkaller go binaries by
doing:

```
$ make TARGETOS=fuchsia TARGETARCH=amd64 \
    SOURCEDIR=$HOME/fuchsia \
    FX_SDK_PATH=${HOME}/sdk/fuchsia-sdk \
    CLANG_PATH=${HOME}/sdk/clang
```

This commits adds two scripts to tools/fuchsia, one for building go in
fuchsia (just calls the ./make.all script in fuchsia's go repo), and one
that replaces the devshell/contrib/go script.

Given that go is unsupported in fuchsia, this change might break at any
point.

[0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/291631
2019-07-23 08:44:20 +02:00
Marco Vanotti
5aec592bda pkg/build: Add ssh keys for fuchsia
This change modifies the way fuchsia is built to add the ssh keys to the
zbi image after building it. Previously that was done via the
"extra_ssh_keys" argument to the build system, but that was removed
recently.
2019-07-23 08:44:20 +02:00
Andrey Konovalov
55e0c07757
sys/linux: extract USB HID ids (#1294)
* sys/linux: extract USB HID ids

As it turns out the HID kernel subsystem registers only one USB driver that
checks that the interface of the connected device has HID class and then looks
up its own list of vendor/device ids to find a matching driver. This means
that we currently don't generate proper vendor/device ids for USB HID devices.

This patch updates the syz-usbgen tool to also extract USB HID vendor/device
ids from a running kernel and makes the generated descriptions for HID devices
to be patched using the extracted ids.

This patch also contains some minor improvements to USB descriptions
(better HID descriptions and more replies for some USB classes/drivers).

* sys/linux: run make generate
2019-07-22 19:25:54 +02:00
Dmitry Vyukov
6a786da97c sys/linux: use AT_FDCWD only for directories
Currently we use AT_FDCWD as a special value for all file descriptors,
but it does not make sense for almost all of them (sockets, bpf, etc).
Use it as a special value only for fd_dir.
2019-07-22 13:05:39 +02:00
Dmitry Vyukov
f3ad684464 executor: drop CAP_SYS_NICE
A process with CAP_SYS_NICE can bring kernel down by asking for too high SCHED_DEADLINE priority,
as the result rcu and other system services that use kernel threads will stop functioning.
Some parameters for SCHED_DEADLINE should be OK, but we don't have means to enforce
values of indirect syscall arguments. Peter Zijlstra proposed sysctl_deadline_period_{min,max}
which could be used to enfore safe limits without droppping CAP_SYS_NICE, but we don't have it yet.
See the following bug for details:
https://groups.google.com/forum/#!topic/syzkaller-bugs/G6Wl_PKPIWI
2019-07-22 11:59:00 +02:00
Dmitry Vyukov
be348f6db3 sys/linux: improve sched_attr description
Today we have means to properly describe parent size.
2019-07-22 11:51:58 +02:00
Dmitry Vyukov
5181b54d45 executor: drop CAP_SYS_PTRACE with sandbox=none
We only drop CAP_SYS_PTRACE for sandbox=namespace,
but it can equally affect testing with sandbox=none.
Drop it for sandbox=none, add a test.
2019-07-22 11:51:53 +02:00
Dmitry Vyukov
e530ec1bef pkg/csource: test sys/*/test programs
Running sys/*/test programs requires real machines and kernels for each OS.
We can't do that in unit tests, but at least try to deserialize these programs
so that they don't get rotten.
2019-07-22 10:20:51 +02:00
Dmitry Vyukov
d8b4c311be pkg/mgrconfig: add example for "enable_syscalls" 2019-07-22 09:27:11 +02:00
Dmitry Vyukov
d6e6e5e69c docs: fix description of ptr type
ptr has direction as the first argument.
2019-07-22 09:23:10 +02:00
Dmitry Vyukov
18678d6989 pkg/report: support older format of "bad usercopy" 2019-07-22 09:07:23 +02:00
Greg Steuck
b3c615f51b tools/syz-execprog: remove unused parameter 2019-07-22 07:37:09 +02:00
Anton Lindqvist
919efc620a sys/openbsd: prevent swap partition device nodes from being created
Writing to the swap partition during fuzzing can lead to all kinds of
corruptions[1].

[1] https://syzkaller.appspot.com/bug?id=a2eca15e6e0be4be3ed1b0b2bab3332edc317b1c
2019-07-22 07:36:41 +02:00
Dmitry Vyukov
1656845f45 fuzz.yaml: rename to fuzzbuzz.yaml
Newsletter says we need to change the name.
2019-07-19 10:45:19 +02:00
Denis Efremov
9097c294da Update found_bugs.md 2019-07-19 10:37:26 +02:00
Dmitry Vyukov
8304907db0 tools/syz-env: restrict Makefile parallelism based on RAM
Ensure that we have at least 1GB per Makefile job.
Go compiler/linker can consume significant amount of memory
(observed to consume at least 600MB). See #1276 for context.
Update #1276
2019-07-19 09:51:07 +02:00
Dmitry Vyukov
7bb222f7bc syz-manager: fix argument order in generateCoverHTML 2019-07-18 09:47:33 +02:00
Dmitry Vyukov
f53c0235fa pkg/cover: fix objdump process hang
One instance we observed that objdump hanged due to stdout
pipe overflow due to panic in archCallInsn.
The reason for the original panic is still unclear,
but fix the objdump hang. We need to terminate objdump
and propagate the panic.
Also extend the panic messages.
2019-07-18 09:37:07 +02:00
Dmitry Vyukov
06616a2715 tools/syz-cover: skip empty lines in coverage file
If it's constructed manually, it's easy to add an empty line at the end.
2019-07-18 09:36:03 +02:00
Siddharth M
f613a7c41d pkg/cover: fix prefix computation
* pkg/cover: Modify parsing logic
1. Remove prefix computation
2. Add a mgrconfig for kernel build directory

* pkg/report: shorten reports with kernelBuildSrc instead of kernelSrc

* pkg/report: Fix failing tests

* pkg/report: fix formating issues

* tools/syz-cover: Fix unintended redefinition

* make changes to fix failing ci build

* pkg/report: fix issues
2019-07-17 11:58:23 +02:00
Marco Vanotti
0d10349cf0
sys/fuchsia: update zx_clock_get syscall (#1292)
* sys/fuchsia: update zx_clock_get.

zx_clock_get was deprecated and replaced by zx_clock_get_new. In a
recent CL[0], they replaced the zx_clock_get by zx_clock_get_new and
moved all client. This commit updates syzkaller to use the new function.

[0]: https://fuchsia-review.googlesource.com/c/fuchsia/+/298575

* run make extract && make generate
2019-07-16 17:09:43 -07:00
Dmitry Vyukov
4ec4ea4890 pkg/report: support new format of "held lock freed" linux bugs 2019-07-16 16:37:33 +02:00
Dmitry Vyukov
96b8132aaf sys/syz-extract: fix too long line 2019-07-16 16:34:29 +02:00
Marco Vanotti
d6d32e566b run make extract and make generate for fuchsia 2019-07-16 16:34:29 +02:00