Commit Graph

3853 Commits

Author SHA1 Message Date
Andrey Konovalov
f41f5458bb pkg/host: enable evdev, hidraw and hiddev when USB fuzzing is on 2019-06-06 09:26:18 +02:00
Anton Lindqvist
73a7d55bdf sys/openbsd: add klog descriptions 2019-06-05 19:18:58 -07:00
Anton Lindqvist
6354390a82 sys/openbsd: add missing wsmouse ioctl descriptions 2019-06-05 19:18:58 -07:00
Anton Lindqvist
a547defcdc executor: add cover protection support to OpenBSD (#1215) 2019-06-05 19:13:28 -07:00
Andrew Turner
bfb4a51e30 executor: Protect the coverage buffer
Add functions to protect and unprotect the coverage buffer. The buffer is
protected from being written to while tracing. When the trace data is
sorted we need to make it read/write, but can return it to read only after
this has completed.

Leave the first page as read/write as we need to clear the length field.
2019-06-04 16:24:36 +02:00
Dmitry Vyukov
ad87cdf3c7 pkg/runtest: detect and ignore flakes
Add retry logic that detects and ignores episodic flakes.
This test episodically flakes on syzbot.
We run with the default timeout, but require a test
to pass in 50+% of cases.
Running 72 test binaries in parallel I am getting 35-44 failures out of 72
with 1 retry. With 3 retries it drops to ~7. With 5 it is close to 0.
Use 7 retries for now. Let's see if it still flakes.
2019-06-04 14:57:43 +02:00
Dmitry Vyukov
8b598c83d2 executor: special-case zx_deadline_after return value
zx_deadline_after also returns time, not status.
So don't use it as coverage.
2019-06-04 14:57:43 +02:00
R3x
e41a20c517 docs/netbsd: Added link to image script 2019-06-04 13:07:51 +02:00
Dmitry Vyukov
61f5c63922 pkg/report: skip refcount_* functions
These are too generic and don't point to any subsystem. Skip them.
2019-06-04 08:53:37 +02:00
Anton Lindqvist
ce07a7aef6 docs/openbsd: update found_bugs.md 2019-06-03 21:24:20 +02:00
Aditya Basu
4a4d36b4af pkg/build: update env variables for akaros
* Remove the environment variable: AKAROS_XCC_ROOT
(refer to commit: brho/akaros bdab8c3a)
* Add environment variable AKAROS_TOOLCHAINS which
points to the parent directory of the old AKAROS_XCC_ROOT.
(refer to commit: brho/akaro 62ec5c3c)
* Add "$AKAROS_TOOLCHAINS/x86_64-ucb-akaros-gcc/bin" to PATH.

Signed-off-by: Aditya Basu <mitthu@google.com>
2019-06-03 18:58:22 +02:00
Bins94
816587a771 sys/linux: update descriptions of sendmsg/sendmmsg
Add sendmsg$inet, sendmmsg$inet for ip_cmsg_send.
Add sendmsg$inet6, sendmmsg$inet6 for ip6_datagram_send_ctl
2019-06-03 18:43:52 +02:00
Andrey Konovalov
63bf051fc1 pkg/report: add del_timer_sync to skip patterns 2019-06-03 13:14:08 +02:00
Dmitry Vyukov
2fa06225ad syz-manager: increase initial poll batch size
When the fuzzer starts, it pumps the whole corpus.
If we do it using the final batchSize, it can be very slow
batch of size 6 can take more than 10 mins for 50K corpus and slow kernel).
Use a batch of 30 initially.
2019-06-03 13:13:56 +02:00
Dmitry Vyukov
5368a448e4 pkg/host: disable syz_execute_func
See the added comment for explanation.
2019-06-03 13:13:56 +02:00
Paul Chaignon
53c81ea538 sys/linux: add missing BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-05-31 17:31:58 +02:00
Andrey Konovalov
142ce68175 pkg/runtest: add simple USB runtest 2019-05-31 13:35:25 +02:00
Andrey Konovalov
c054a92dde pkg/csource: generate timeouts for USB syzcalls
This patch only covers per call timeouts, per prog one is not adjusted yet.
2019-05-31 13:35:25 +02:00
Andrey Konovalov
a8482b78fb sys/linux/vusb.txt: more descriptions to be done 2019-05-31 13:24:54 +02:00
Paul Chaignon
d9aaf3c288 sys/linux: add missing BPF constants
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
2019-05-29 16:17:05 +02:00
Andrey Konovalov
2673c53079 pkg/report: ignore more frames for warnings in usb_submit_urb 2019-05-29 16:16:46 +02:00
Andrey Konovalov
c87d57e3e0 dashboard: update USB configs to the latest usb-linus
Also clean up config generation scripts a bit.
2019-05-29 15:56:43 +02:00
Dmitry Vyukov
2c7afa511c sys/targets: fix freebsd/386 executor build on some hosts
Add -B/usr/lib32 to 386 build flags.
The story behind -B/usr/lib32 is not completely clear, but it helps in some cases.
For context see discussion in https://github.com/google/syzkaller/pull/1202
2019-05-29 15:44:25 +02:00
Dmitry Vyukov
f5a25d38ac pkg/cover: factor out common code into combinePrefix
Combining of prefixes is now repeated in 2 places.
Factor it out into a common function.
2019-05-29 14:58:40 +02:00
Michael Tuexen
59a32682c0 pkg/cover: further improve prefix computation
When computing the prefix, take the covered and uncovered PCs into
account.
2019-05-29 14:58:36 +02:00
Michael Tuexen
17c2df6f20 pkg/cover: improve prefix computation
When the prefix becomes the empty string during the computation,
stop computing it, since the empty string is the result.
2019-05-29 14:58:31 +02:00
Andrew Turner
5457ef3463 sys/freebsd: Add support for fuzzing FreeBSD/i386
Add support to fuzz 32 bit FreeBSD system calls.
2019-05-29 14:28:59 +02:00
Andrey Konovalov
6bd615015d pkg/repro: don't double-reverse log entries
For extractProgSingle() lastEntries are already reversed, so no need to
call reverseEntries().

Also for extractProgBisect() there's no point in reversing the entries,
as the idea is to try connecting multiple programs in chronological order.
2019-05-27 20:03:37 +02:00
Andrey Konovalov
d53d0cd242 pkg/report: improve usb_submit_urb report titles 2019-05-27 13:52:30 +02:00
Dmitry Vyukov
d8aa8b73f5 dashboard/app: add invalid bugs page
Currently it's not possible to list all invalid bugs.
Add a page that does this.
It's not referenced from anywhere as it's unclear who/when
needs it on periodic basis. But if the list is needed
for something one-off, we have it.
2019-05-27 11:28:02 +02:00
Dmitry Vyukov
562efd79c7 docs: add section about KMEMLEAK to syzbot doc 2019-05-27 10:50:10 +02:00
Anton Lindqvist
85c573157d pkg/csource: add ability to annotate syscalls using comments in C reproducers
Providing additional info, especially regarding syscall arguments, in reproducers
can be helpful. An example is device numbers passed to mknod(2).

This commit introduces an optional annotate function on a per target basis.

Example for the OpenBSD target:

  $ cat prog.in
  mknod(0x0, 0x0, 0x4503)
  getpid()
  $ syz-prog2c -prog prog.in
  int main(void)
  {
    syscall(SYS_mmap, 0x20000000, 0x1000000, 3, 0x1012, -1, 0, 0);
    syscall(SYS_mknod, 0, 0, 0x4503); /* major = 69, minor = 3 */
    syscall(SYS_getpid);
    return 0;
  }
2019-05-24 22:33:56 +02:00
R3x
0dadcd9d91 pkg/build: Add the KCOV build commands 2019-05-23 08:48:16 +02:00
Dongliang Mu
84b9d38467 doc/linux: add one link for linux in the README.md (#1194) 2019-05-21 18:59:22 -07:00
Pascal Perez
0625bb5c4c sys/fuchsia: Updating Fuchsia definitions
Simply

	make extract TARGETOS=fuchsia SOURCEDIR=<FUCHSIA_DIR>/fuchsia
2019-05-21 14:55:36 -07:00
Pascal Perez
77beeccbe0 sys: Updating Fuchsia extraction scripts
Consolidating FIDL library build mappings in one place, so that it can
be used from extraction, and script invoking fidlgen. This also makes
code clearer, and provides a more natural path for evolutions / dealing
with oddities.

Minor doc update post fx command changes.
2019-05-21 14:55:36 -07:00
Dmitry Vyukov
13427bd9a9 pkg/vcs: disable CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER before v5.2
See https://groups.google.com/d/msg/syzkaller/mODXmnauUZM/HLZiO2UDBAAJ for context.
2019-05-21 16:50:29 +02:00
R3x
9809825e48 make changes to prevent failing build 2019-05-21 13:56:38 +02:00
Dmitry Vyukov
712bfcbdd8 pkg/runtest: test host.Setup
This would catch binfmt_misc breakage on non-linux.
2019-05-21 12:35:51 +02:00
Dmitry Vyukov
4adc00e894 syz-manager: reproduce leaks from hub
pkg/repro only enables leak checking when report type is MemoryLeak.
Since repros from hub always have Unknown type, repro won't reproduce leaks.
Always set report type to MemoryLeak on leak instances.
2019-05-21 12:25:10 +02:00
Dmitry Vyukov
f35ffcc16f pkg/host: don't enable binfmt_misc on non-linux
The csource options lack any relation to the tested OS,
while they do depend on the tested OS (most are linux-specific).
As the result we enable binfmt_misc, but its setup fails on anything
other than linux. As a work-around don't enable binfmt_misc on non-linux.
2019-05-21 12:23:44 +02:00
Dmitry Vyukov
d46b0931bd syz-fuzzer: setup host features during image testing 2019-05-21 12:22:58 +02:00
Dmitry Vyukov
40957b8193 executor: exit after first detected leak in C repros
Otherwise C repros print infinite stream of the same leaks again and again.
2019-05-21 12:00:02 +02:00
Dmitry Vyukov
e503f048b0 docs: don't duplicate manager config parameters
Currently we have them duplicated in docs/configuration.md
and the actual source in pkg/mgrconfig/config.go.
Documentation is missing in one place or another,
some is outdated, some is phrased slightly differently.
Move all docs to pkg/mgrconfig/config.go and reference it
from docs/configuration.md instead.
2019-05-21 11:47:51 +02:00
Dmitry Vyukov
8285069f89 executor: implement support for leak checking
Leak checking support was half done and did not really work.
This is heavy-lifting to make it work.

1. Move leak/fault setup into executor.
pkg/host was a wrong place for them because we need then in C repros too.
The pkg/host periodic callback functionality did not work too,
we need it in executor so that we can reuse it in C repros too.
Remove setup/callback functions in pkg/host entirely.

2. Do leak setup/checking in C repros.
The way leak checking is invoked is slightly different from fuzzer,
but much better then no support at all.
At least the checking code is shared.

3. Add Leak option to pkg/csource and -leak flag to syz-prog2c.

4. Don't enalbe leak checking in fuzzer while we are triaging initial corpus.
It's toooo slow.

5. Fix pkg/repro to do something more sane for leak bugs.

Few other minor fixes here and there.
2019-05-20 19:40:20 +02:00
Dmitry Vyukov
7b3084af2e syz-manager: don't repro non-leaks on leak instance
Leak checking is too slow to reproduce other bugs.
2019-05-20 19:40:20 +02:00
Dmitry Vyukov
32ebe81cf3 pkg/repro: fix no output timeout
We duplicated the no output timeout in the repro package,
and it got out of sync. It's not 3 mins now, but 5 mins.
Remove the duplication and fix this.
2019-05-20 19:40:20 +02:00
Dmitry Vyukov
2c9280d432 pkg/rpctype: use string type for leak frames
We need them as string everywhere.
Not sure why they were []byte to begin with.
2019-05-20 19:40:20 +02:00
Dmitry Vyukov
4d4a4420e7 pkg/report: add Type/Frame to Report
In several places we do special handling for some crash types.
Currently we compare report title with magic strings,
which is error-prone. Add explicit Type to reports.
2019-05-20 19:40:20 +02:00
Dmitry Vyukov
cddddce85a dashboard/config: update kmemleak config
Update to latest linux.
Enable configs enabled in the kasan config.
2019-05-20 19:40:20 +02:00