Commit Graph

1519 Commits

Author SHA1 Message Date
Albert van der Linde
d7a01d53f7 sys/linux: add descriptions for raw character devices 2020-07-20 11:30:15 +02:00
Dmitry Vyukov
8caeeeb724 pkg/report: parse linux undead task reports 2020-07-20 10:42:01 +02:00
Zubin Mithra
9c8124727c sys/linux: add descriptions for i915 driver 2020-07-17 15:26:11 +02:00
Dmitry Vyukov
c4b454fc54 pkg/runtest: tell ASAN to not mess with our NONFAILING
It seems that different gcc's have different defaults for ASAN flags.
Some fail with:

        run.go:67: nonfailing none/thr/repeat            : FAIL: run 0: call 0 is not executed
            	ASAN:DEADLYSIGNAL
            	=================================================================
            	==67143==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f7b0befb0a2 bp 0x7f7b0cfdad10 sp 0x7f7b0cfda490 T1)
            	    #0 0x7f7b0befb0a1  (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x8d0a1)
            	    #1 0x404bbb in syz_compare(long, long, long, long) (/tmp/utor355225125.0+0x404bbb)
            	    #2 0x403cdf in execute_call(thread_t*) (/tmp/utor355225125.0+0x403cdf)
            	    #3 0x404006 in worker_thread(void*) (/tmp/utor355225125.0+0x404006)
            	    #4 0x7f7b0bc584a3 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x74a3)
            	    #5 0x7f7b0b99ad0e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8d0e)

            	AddressSanitizer can not provide additional info.
            	SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x8d0a1)
            	Thread T1 created by T0 here:
            	    #0 0x7f7b0be9ef59 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f59)
            	    #1 0x406117 in execute_one() (/tmp/utor355225125.0+0x406117)
2020-07-16 12:22:57 +02:00
Dmitry Vyukov
13d5e89e02 executor: remove NONFAILING from pseudo-syscalls
This is not needed anymore afer the previous commit.

Fixes #1918
2020-07-15 09:26:23 +02:00
Dmitry Vyukov
b458f2c1a6 executor: wrap all syscalls into NONFAILING
Currently we sprinkle NONFAILING all over pseudo-syscall code,
around all individual accesses to fuzzer-generated pointers.
This is tedious manual work and subject to errors.
Wrap execute_syscall invocation with NONFAILING in execute_call once instead.
Then we can remove NONFAILING from all pseudo-syscalls and never get back to this.
Potential downsides: (1) this is coarser-grained and we will skip whole syscall
on invalid pointer, but this is how normal syscalls work as well,
so should not be a problem; (2) we will skip any clean up (closing of files, etc)
as well; but this may be fine as well (programs can perfectly leave open file
descriptors as well).

Update #1918
2020-07-15 09:26:23 +02:00
Dmitry Vyukov
6b24f02a11 pkg/runtest: allow to select a subset of tests to run 2020-07-15 09:26:23 +02:00
Dmitry Vyukov
e2f6c0c1b5 sys/targets: don't use HostFuzzer mode for test OS
We set HostFuzzer for all test targets b/c in some contexts
they needed the same special behavior as real HostFuzzer targets
(e.g no checking enabled syscalls).
However, in some other contexts they don't the same special
behavior as real HostFuzzer targets. For example, pkg/ipc
does rate limiting for HostFuzzer and pkg/runtest don't run
C tests for HostFuzzer.

Add special case for test targets in pkg/host,
and don't set HostFuzzer for all test targets
(keep it for one target for better coverage).
2020-07-15 09:26:23 +02:00
Albert van der Linde
230553f68f prog/types.go: add Type.Alignment() and TypeCommon.TypeAlign
Type.Alignment() can be used to obtain byte alignment for
correctly allocating aligned memory for the Type.
2020-07-14 12:20:37 +02:00
Dmitry Vyukov
c1147c8df7 all: fix comments format
Fix capitalization, dots at the end
and two spaces after a period.

Update #1876
2020-07-12 08:22:44 +02:00
Dmitry Vyukov
0faffd0438 syz-ci: set Timeout for bisections
Add Timeout config param for bisections.
Specify timeout in syz-ci as 8h based on the following data.

Out of 1049 cause bisections that we have now:
-  891 finished under  6h (84.9%)
-  957 finished under  8h (91.2%)
-  980 finished under 10h (93.4%)
-  989 finished under 12h (94.3%)
- 1011 finished under 18h (96.3%)
- 1025 finished under 24h (97.7%)

There is also a significant increase in errors/inconclusive bisections after ~8h.
Out of 4075 fix bisections:
- 4015 finished under  6h (98.5%)
- 4020 finished under  8h (98.7%)
- 4026 finished under 10h (98.8%)
- 4032 finished under 12h (98.9%)
Significant increase in errors starts after ~12h.

The current timeout also take into account that bisection jobs
compete with patch testing jobs (it's bad delaying patch testing).
When/if bisection jobs don't compete with patch testing,
it makes sense to increase this to 12-24h.

Fixes #1923
2020-07-12 08:22:14 +02:00
Dmitry Vyukov
1ad470c265 pkg/vcs: don't sandbox syzkaller repo
Currently we sandbox all repos b/c we assumed
that all builds are also sandboxes. But this causes
havoc for bisection/patch testing b/c syzkaller build
is not actually sandboxed anywhere. Build creates
root-owned files and then git can't do anything with them
but don't report errors either:

$ git checkout 8eda0b95 && echo OK
error: unable to unlink old 'sys/linux/gen/386.go': Permission denied
error: unable to unlink old 'sys/linux/gen/ppc64le.go': Permission denied
...
HEAD is now at 8eda0b957e
OK

We trust own sources and we don't test syzkaller patches,
so don't sandbox syzkaller repos.
2020-07-12 08:22:14 +02:00
Mark Johnston
7ba05d2dd6 pkg/build: always truncate loader.conf on FreeBSD
Otherwise we append the same lines to the file upon each build.
2020-07-11 08:49:28 +02:00
Mark Johnston
ca5272b763 pkg/build: load the SCTP and IPSec stacks on FreeBSD
IPSec is not compiled into GENERIC kernels and must be loaded.  SCTP
currently is compiled into GENERIC, but this is expected to change.
2020-07-11 08:49:28 +02:00
Dmitry Vyukov
78178cfb8c tools/syz-linter: fix comments check
Turns out ast.Inspect does not visit most comments.
Walk file.Comments manually.

Update #1876
2020-07-10 19:15:46 +02:00
Alexander Egorenkov
56d01184e3 executor: fix bitfields for big-endian arch
Add bitfield tests for big-endian arch

Issue: #1885

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
2020-07-10 10:25:58 +02:00
Dmitry Vyukov
353d190191 dashboard/app: add navigation buttons
Currently we have only "fixed" link at the top of the page.
"invalid" is missing and this is not scalable.
Add natigation buttons (tabs) for main pages.
2020-07-09 19:40:12 +02:00
Dmitry Vyukov
894db56cb2 pkg/html: add function to format JS time 2020-07-09 19:40:12 +02:00
Dmitry Vyukov
bae5742c50 pkg/report: tune synchronize_srcu name for older kernels 2020-07-08 09:26:48 +02:00
Dmitry Vyukov
08fc4ef14d pkg/report: make smp_call_function anchor instead of on_each_cpu
Right after committing the on_each_cpu change,
another report come in where smp_call_function
is not called from on_each_cpu. And there are
actually more such callers in code, and also
as existing tests show. smp_call_function seems
to be the better root cause indication.
2020-07-07 12:04:22 +02:00
Dmitry Vyukov
f7b01f08a3 pkg/vcs: fix config bisection tests more
config-bisect.pl uses bash-isms and can't run on non-linux.
It also silently ignores all errors which made failures
very obscure -- the script happily succeeds in presence
of any errors. So the test failed later reading .config.
Use "set -eu" to not fail silently.
Also trace all config-bisect.pl invocations and output.
good/bad decisions are important and we always log them
in the normal bisection.
2020-07-07 10:40:55 +02:00
Dmitry Vyukov
e419f4e6d8 pkg/report: consider on_each_cpu as stall anchor function
Kernel frequently hangs in on_each_cpu,
it seems to be more indicative of the root cause
than subsequent frames.
2020-07-07 10:40:55 +02:00
Dmitry Vyukov
3f3be050c0 pkg/vcs: fix config bisection test
/bin/bash is usually installed on linux'es,
but not on other OSes, e.g. *BSDs.
Use /bin/sh instead of /bin/bash.
2020-07-07 08:47:36 +02:00
Dmitry Vyukov
ef6b94b522 pkg/vcs: fix config minimization test
The test requires new git binary.
It's not necessary installed everywhere.
Skip the test if git binary does not support bisection.

Also reoder functions from more important to less important.
Mark the test as parallel.
Move individual tests into subtests.
Split trace per subtest.
2020-07-07 08:36:58 +02:00
Dmitry Vyukov
ef278c737f pkg/report: use rtnetlink_rcv_msg as stall anchor frame
It also hash high branching factor and a bug is more likely in the callback.
For the added test we used to say:
INFO: rcu detected stall in __sys_sendmsg
now we say more useful:
INFO: rcu detected stall in tc_modify_qdisc
2020-07-06 17:26:25 +02:00
Dmitry Vyukov
36db93ffb9 pkg/osutil: remove appengine tag
Appengine doesn't provide appengine tag anymore.
Resort to use of syscall package for ExitStatus instead.
2020-07-06 15:59:35 +02:00
Dmitry Vyukov
4e3820bfb2 pkg/osutil: don't use os.ProcessState.ExitCode on appengine
It's not present in Go 1.11.
2020-07-06 15:04:35 +02:00
Dmitry Vyukov
3940e7a64f all: fix log/error text starting with capital letter
Update #1876
2020-07-05 10:55:16 +02:00
Dmitry Vyukov
813f363bff all: fix dup types in func args 2020-07-04 15:05:30 +02:00
Dmitry Vyukov
fcb219b67e all: don't compare string len with 0
For strings it's more readable to compare the string itself with "",
instead of comparing len with 0. Fix all such cases.

Update #1876
2020-07-04 15:05:30 +02:00
Dmitry Vyukov
74cb4e09a5 go.mod: add go-fuzz-build
Otherwise go-fuzz-build now fails with:

+ go-fuzz-build -libfuzzer -func FuzzDeserialize -o fuzzer.a ./prog/test
-: cannot find package "." in:
	/syzkaller/gopath/src/github.com/google/syzkaller/vendor/github.com/dvyukov/go-fuzz/go-fuzz-dep
2020-07-04 15:05:30 +02:00
Dmitry Vyukov
c7d7f10bdf go.mod: vendor golangci-lint 2020-07-04 15:05:30 +02:00
Dmitry Vyukov
0bb197026a pkg/vcs: reset state even more
"git clean -fd" does not remove ignored files,
while can mess state when .gitignore changes across commits.
Use "git clean -fdx" to delete ignored files as well.
2020-07-04 08:35:28 +02:00
Dmitry Vyukov
6e569755ce pkg/mgrconfig: extend proc param description 2020-07-03 13:09:05 +02:00
Dmitry Vyukov
f30c14bfec pkg/bisect: fix noop change detection with config minimization
Config minimization did not update test results for the starting commit.
Test result for the starting commit still refered to the original config,
not the minimized config that was actually used during bisection.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
39ffeee9d8 pkg/bisect: improve config minimization tests
Change a test to actually produce a new config as it is supposed
to do during config minimization and check the resulting config.

Add a regression test for the bug where we committed a broken config.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
8531773447 pkg/bisect: move checking of minimized config into common code
That part is not linux-specific, move it to the common code.
The more code we have in the common code, the more code we can test.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
63b5e2d7d2 pkg/bisect: don't overwrite user configuration
We don't own this object and should not touch,
it may be unexpected by the caller and may cause data races.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
a1f1bc47d3 pkg/bisect: test resulting config
One of main outputs of the config minimization is the new config,
but tests don't do any single check of it.
Check the resulting config (is it correct in all cases?).
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
e8fcf811ec pkg/bisect: don't ignore errors during config minimization
Ignoring errors is bad. It leads to silent failures.
If there is some particular error condition that is expected
to happen and we want to ignore, we need to ignore that one only
rather than all potenital errors in the whole process.
2020-07-02 10:56:05 +02:00
Dmitry Vyukov
1640a9d528 pkg/bisect: minor style fix ups 2020-07-02 10:56:05 +02:00
Dmitry Vyukov
31792dba46 pkg/bisect: fix crash when all releases are broken
Currently we crash with nil deref in this special case.
2020-07-02 10:56:05 +02:00
Jouni Hogander
f8885dc4ce pkg/bisect: Implement config bisection
Implement Linux kernel configuration bisection. Use bisected minimalistic
configuration in commit bisection. Utilizes config_bisect.pl script from Linux
kernel tree in bisection.

Modify syz-bisect to read in kernel.baseline_config. This is used as a "good"
configuration when bisection is run.
2020-07-02 09:32:57 +02:00
Jukka Kaartinen
d42301aa2f Pass baseline config around
Add new new Syzkaller configuration option kernel_baseline_config. This option
is supposed to be used by kernel configruation bisection as a "good" config"

Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
Signed-off-by: Jouni Hogander <jouni.hogander@unikie.com>
2020-07-02 09:32:57 +02:00
Tobias Klauser
df01f6fc27 pkg/osutil: use functionality from x/sys/unix
Use unix.Unmount instead of manually wrapping SYS_UMOUNT2.

Use unix.IoctlSetPointerInt instead of manually wrapping SYS_IOCTL. This
also allows to use FS_IOC_SETFLAGS instead of manually defining it for
each GOARCH.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-29 13:34:06 +02:00
Necip Fazil Yildiran
3ff434cc0a executor: enable cgroup/cpuset memory pressure calc.
Enable the cpuset.memory_pressure_enabled flag in the root cpuset.
2020-06-29 11:07:03 +02:00
Dmitry Vyukov
0375051c14 pkg/host: increase executor setup timeout
For context see:
https://groups.google.com/d/msg/syzkaller/7yOtIJGW2sw/Siw8mtu0CAAJ
2020-06-29 07:13:19 +02:00
m00nbsd
a2cdad9d42
executor/netbsd: base nth on 2 (#1874) 2020-06-27 17:24:37 +02:00
Tobias Klauser
9506ea6dcf pkg/host: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00
Tobias Klauser
1cbaafd119 executor: add support for linux/riscv64
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-26 16:41:30 +02:00