Commit Graph

5122 Commits

Author SHA1 Message Date
Dmitry Vyukov
17b3eb97de prog: speed up foreachArgImpl
Don't generate garbage for ctx.
This speeds up mutation tests by 20%.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
9d7b583eae prog: reduce size of -short tests
Reduce size of tests that run for more than 1s in short mode.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
b6fa239fd5 pkg/csource: speed up tests
Tests run for too long.
1. Check only 1 arch per OS in short mode.
2. Dedup options. Turns out we generated 2x duplicates in allOptionsSingle.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
04875dc644 pkg/bisect: speed up tests
Creating new repos takes majority of test time.
Reuse them across tests.
With GOMAXPROCS=2 (CI) this speeds up tests from 33 sec to 7 secs.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
0ee915a4b7 pkg/runtest: disable broken test combinations
Amusingly this was always broken but nobody was ever able to compile
32-bit binaries on Linux since the addition of the tests.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
67206203d3 pkg/runtest: enable 32-bit tests
32-bit tests should work on CI now.
But don't run them in -short mode,
otherwise it takes too long.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
672c10ad7c all: add missing copyright statements 2020-05-18 11:34:42 +02:00
Dmitry Vyukov
554f8f39c5 pkg/ast: print full file name in errors
Print full names so that github annotations work.
I.e. sys/linux/sys.txt instead of just sys.txt.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
2d4efabd02 Makefile: print errors in standard format
Use the standard "file:line:col: error message" format.

Update #1699
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
fc28aeb6b9 tools/check_links.py: print errors in standard format
Use the standard "file:line:col: error message" format.

Update #1699
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
51c18193d3 tools/check-copyright.sh: print errors in standard format
Use the standard "file:line:col: error message" format.

Update #1699
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
bb26bde008 tools/check-copyright.sh: check py and yml files
Update #1699
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
58d6f672b9 sys/targets: check that <dirent.h> works in compilation test
Without linux-libc-dev:i386 installed the test passes,
but executor compilation fails because <dirent.h> is broken.
2020-05-18 11:34:42 +02:00
Dmitry Vyukov
1eaedf0fea pkg/osutil: don't sandbox on CI
CI does not have syzkaller user, but may run under root.

Update #1699
2020-05-18 11:34:42 +02:00
Ayushi Sharma
37bccd4ed9 sys/netbsd: increase syscall support 2020-05-15 13:43:55 -07:00
Andrey Konovalov
8a9f1e7dbd executor, sys/linux: syz_usb_ep_read/write accept endpoint address
This patch changes syz_usb_ep_read/write pseudo-syscalls to accept endpoint
address as specified in its endpoint descriptor, instead of endpoint index.
2020-05-15 16:30:32 +02:00
Andrey Konovalov
55efafca37 executor: stall unknown usb requests
Also don't fail(), leave that to USB_DEBUG and analyze_control_request().
2020-05-15 16:30:32 +02:00
Alexander Potapenko
d7f9fffab3 targets: syz-extract: add Clang support for Linux builds
Allow targets.go use Clang instead of the default Linux compiler by
setting the SYZ_CLANG=1 env var. Doing so changes the compiler to
"clang" and the linker to "ld.ldd", assuming they are in $PATH, and adds
the --target and -ferror-limit CFLAGS.

Target also exports KernelCompiler and KernelLinker fields now, which allows
overriding the compiler and linker in the kernel make invocation.

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-15 14:08:01 +02:00
Alexander Potapenko
4da021feb0 targets.go: append flags in a more readable way
As suggested by Dmitry Vyukov

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-15 14:08:01 +02:00
Alexander Potapenko
e2993cfc13 targets: replace target.CCompilerPrefix with target.Triple
This field will soon be used in Clang builds. Also, we'd better
encapsulate compiler name generation in targets.go

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-15 14:08:01 +02:00
Michael Tuexen
2d572622ca sys/targets: fix typo 2020-05-14 11:06:41 +02:00
Michael Tuexen
4dcd09e8cb sys/targets: add -lc++ when building for test os on FreeBSD
This unbreaks gmake presubmit on FreeBSD.
2020-05-14 11:06:41 +02:00
Michael Tuexen
e36b2ae53d sys/targets: fix tests when building on FreeBSD
gmake test is failing on FreeBSD since switching to clang.

To address this:
* use g++ as the C preprocessor for now.
* use a C compiler for compiling C sources and add -lc++ when
  compiling executor.cc. Without this, clang warns about
  using a C++ compiler for compiling C code.
* some test configs add -no-pie, which is not used by clang.
  Add -Wno-unused-command-line-argument to silence a warning
2020-05-14 11:06:41 +02:00
Michael Tuexen
a885920d00 executor: don't build gen.go on FreeBSD 2020-05-13 21:50:15 +02:00
Michael Tuexen
d9fecf2516 executor: don't build gen.go on OpenBSD or NetBSD
Use (NOT openbsd) AND (NOT netbsd) instead of (NOT openbsd) OR (NOT netbsd).
2020-05-13 21:50:15 +02:00
Dmitry Vyukov
50749f54cd pkg/report: add ParseAll
ParseAll returns all reports in output.
Use it in syz-symbolize.
2020-05-13 20:49:07 +02:00
Dmitry Vyukov
1e61c8bc14 Makefile: add target for syz-symbolize 2020-05-13 20:48:47 +02:00
Dmitry Vyukov
3d789641a3 pkg/report: add Report.SkipPos
SkipPos is what pkg/instance needs,
but also will be needed for ParseAll.
2020-05-13 20:37:26 +02:00
Michael Tüxen
b3fe7470a4
executor: fix typo (#1737) 2020-05-13 17:50:20 +02:00
Michael Tuexen
c7875f08e1 executor: fix #ifdef condition for remove_dir() 2020-05-13 15:56:14 +02:00
Dmitry Vyukov
08381b1a9a
docs: add articles by Collabora 2020-05-13 13:12:07 +02:00
Alexander Potapenko
a99fd8b014 targets: introduce osCommon.cflags, make -static a common flag on Linux
Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-13 13:05:41 +02:00
Alexander Potapenko
88a97d1a7a Get rid of "Cross" in variable names
Renamed Target.BrokenCrossCompiler to Target.BrokenCompiler and
Target.CrossCFlags to Target.CFlags

"Everything in Target is about Cross now."

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-13 13:05:41 +02:00
Alexander Potapenko
ad606d93b2 targets: delete CFlags
According to
https://github.com/google/syzkaller/pull/1732#issuecomment-627809865,
they have been unused since 3aa3800.

Signed-off-by: Alexander Potapenko <glider@google.com>
2020-05-13 13:05:41 +02:00
Dmitry Vyukov
9a6d42fb40 Makefile: fix check_links
1. Disable pager.
2. Actually fail.
2020-05-13 11:42:59 +02:00
Dmitry Vyukov
a44eb8f7ea syz-manager: more consistently check disabled syscalls
We have program "validity" check duplicated 4 times
(initially it was just "does it deserialize?").
Then we added program length and disabled syscall.
But some of the sites have only a subset of checks.
Factor out program checking procedure into a separate function
and use it at all sites.
2020-05-12 15:26:07 +02:00
Dmitry Vyukov
9cea41ad33 sys/syz-sysgen: fix up linux/arm/kvm hack
We have some private files that need to be excluded as well... oh, hacks.
2020-05-12 11:58:00 +02:00
Michael Tuexen
64d61b4117 vm/vmimpl: Don't show ktr, but uma on FreeBSD
Right now, kernels are not build with KTR support, so don't
run show ktr. Add showing information about zones like vmstat -z
would show.
2020-05-12 11:25:51 +02:00
Dmitry Vyukov
160c769827 pkg/mgrconfig: fix errors reported by linter
pkg/mgrconfig/load.go:78:1: cyclomatic complexity 26 of func `Complete` is high (> 24)
sys/targets/targets.go:217: File is not `gofmt`-ed with `-s`
2020-05-12 09:15:58 +02:00
Michael Tuexen
a497a5b4b9 sys/targets: don't remove CrossCFlags 2020-05-12 08:46:41 +02:00
Michael Tuexen
1670262071 sys/targets: use clang on FreeBSD 2020-05-12 08:46:41 +02:00
Ayushi Sharma
44aa83104c
sys/netbsd: add access(2) 2020-05-11 23:18:48 -07:00
Dmitry Vyukov
9eb09c4009 pkg/mgrconfig: convert all paths to absolute
Qemu can use ssh key after chdir to workdir.
Consistently apply Abs to all paths.
2020-05-11 17:03:56 +02:00
Dmitry Vyukov
b026d481be pkg/report: skip "rwsem" frames in task hung reports 2020-05-11 16:54:55 +02:00
Dmitry Vyukov
f4bf31dc3c sys/syz-extract: use -nostdinc on linux
This makes the build completely hermetic.
2020-05-11 16:54:44 +02:00
Dmitry Vyukov
b17a8c4474 sys/linux: extract consts on next-20200511 2020-05-11 16:54:44 +02:00
Dmitry Vyukov
7711af6356 sys/syz-extract: don't warn about unsupported consts for 1 arch
Only warn about unsupported consts when generating consts for all arches.
2020-05-11 16:54:44 +02:00
Dmitry Vyukov
d44f7473de sys/syz-extract: add another compiler message about missing const
New message from clang.
2020-05-11 16:54:44 +02:00
Ayushi Sharma
3b3a2b78da
sys/netbsd: add __getcwd(2) (#1725) 2020-05-11 00:03:33 -07:00
Andrey Konovalov
f8f57555cd docs/contributing.md: updates 2020-05-11 08:29:31 +02:00