Commit Graph

5209 Commits

Author SHA1 Message Date
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
Greg Steuck
4272335555 Makefile: avoid non-portable realpath
pwd -P works great and is portable.
This fixes OpenBSD ci.
2020-07-07 07:28:07 +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
ac5a135b30 tools/syz-linter: introduce helper Pass type
Introduce a helper Pass type so that we can have
some helper methods on it.

Update #1876
2020-07-06 08:23:03 +02:00
Dmitry Vyukov
3e0ce485a1 tools/syz-linter: check variable declarations
Warn about:

var x int = foo

In most cases this can be expressed shorter as:

var x int
x := foo
x := int(foo)

Update #1876
2020-07-06 08:23:03 +02:00
Dmitry Vyukov
ed2ced4c69 tools/syz-linter: check for \n at the end of log/error text
Update #1876
2020-07-06 08:23:03 +02:00
Dmitry Vyukov
22f8756722 tools/syz-linter: check log/error text ending with dot
Update #1876
2020-07-05 10:55:16 +02:00
Dmitry Vyukov
214e3e269c tools/syz-linter: check log/error text starting with capital letter
Update #1876
2020-07-05 10:55:16 +02:00
Dmitry Vyukov
3940e7a64f all: fix log/error text starting with capital letter
Update #1876
2020-07-05 10:55:16 +02:00
Necip Fazil Yildiran
37d770b0c3 sys/linux: improved the descriptions for cgroup
fix: hugetlb.<hugepagesize>.limit_in_bytes can be set.
     hugetlb.<hugepagesize>.usage_in_bytes is for reading.

added descriptions for the following resource controllers:
 net_cls, net_prio, devices, freezer.
2020-07-05 09:14:39 +02:00
Dmitry Vyukov
24d7f50531 tools/syz-linter: add check for dup types in func args
Add check for:

func foo(a int, b int) -> func foo(a, b int)

Update #1876
2020-07-04 15:05:30 +02:00
Dmitry Vyukov
813f363bff all: fix dup types in func args 2020-07-04 15:05:30 +02:00
Dmitry Vyukov
85b1d37b14 tools/syz-linter: add check for comment format
Update #1876
2020-07-04 15:05:30 +02:00
Dmitry Vyukov
c992206a1d tools/syz-linter: add custom linter
For now we have 2 simple checks:

1. for multiline comments:
/* */ -> //

2. for string len comparison with 0:
len(str) != 0 -> str != ""

Update #1876
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
9573094ce2 go.mod: upgrade some dependencies
Since we started using modules, it's a good time to update some deps.
Update to latest official versions packages that have newer versions.

Update #1247
2020-07-04 15:05:30 +02:00
Dmitry Vyukov
dcff124efb go.mod: switch to modules for dependency management
Godep is long deprecated and modules is the future.
Updating dependencies with godep is painful and non-transparent.
This will hopefully help to create custom golangci-lint linters.
The change was created with:

go mod init
rm -rf vendor
go mod vendor

Fixes #1247
2020-07-04 15:05:30 +02:00
Dmitry Vyukov
4f739670f7 .github/CODEOWNERS: assign vendor/ changes to dvyukov
Currently vendor updates assign all OS reviewers b/c they mention *bsd files.
Override this with assigning all vendor/ to dvyukov.
2020-07-04 12:04:37 +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
Necip Fazil Yildiran
510951950d sys/linux: added descs. for DEVLINK_CMD_TRAP_POLICER 2020-07-03 20:39:30 +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
Dmitry Vyukov
bed103955b codecov.yml: suppress coverage errors even more
We are still getting nacks from codecov on PRs after the previous commit.
Try to add patch section to prevent failures.
2020-07-01 22:57:25 +02:00
Tobias Klauser
695ef2ddb2 docs/linux: use OpenSBI instead of BBL to boot linux/riscv64 QEMU VM
OpenSBI seems to be the recommended boot method nowadays, see e.g. [1],
[2]

[1] https://riscv.org/2019/01/risc-v-community-releases-opensbi-to-foster-continued-ecosystem-growth/
[2] https://wiki.freebsd.org/riscv#OpenSBI

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-07-01 21:29:39 +02:00
Dmitry Vyukov
39acb39de2 codecov.yml: suppress coverage errors more
Somehow informational:true is not enough to not produce errors.
We are constantly getting nacks on PRs like:
  x codecov/patch — 59.2% of diff hit (target 65.3%)
Add back and relax target and treshold.
2020-07-01 13:55:27 +02:00
Dmitry Vyukov
090d8f7bdf sys/linux: add riscv_flush_icache syscall
+extract constants on next-20200701
2020-07-01 10:57:23 +02:00
Tobias Klauser
33576216a5 docs/linux: mention CONFIG_KMEMLEAK in suggested kernel configs
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-07-01 10:43:09 +02:00
Anton Lindqvist
c0383ebe66 sys/openbsd: add missing wskbd ioctl descriptions 2020-06-30 21:08:59 +02:00
Jiaheng Hu
917afeaa70 sys/linux: add faccessat2
Added the faccessat2 description (linux 5.8) (https://git.kernel.org/linus/c8ffd8bcdd28296a).
2020-06-29 13:44:45 -07:00
Anton Lindqvist
cc1e9bc12d sys/openbsd: neutralize yet another pf ioctl command
Disarms the latest reproducer[1] for the discovered "no output from test
machine" panic.

While here, tidy up and improve comments.

[1] https://syzkaller.appspot.com/bug?id=4c3b1ac22d6d7f1d9ebcad5469a28cb4562debda
2020-06-29 21:36:27 +02:00
Dmitry Vyukov
ce9ef6f2ec docs/linux: change suggested kernel git repo
Suggest to checkout linux kernel from kernel.org rather than from github.
github is a mirror and we don't use it ourselves and I think it's
generally not used by kernel developers. The kernel.org repo is
the canonical location.
2020-06-29 15:28:14 +02:00
Andrey Konovalov
708d6e5be1
Update setup_ubuntu-host_qemu-vm_x86-64-kernel.md 2020-06-29 15:05:07 +02:00
Andrey Konovalov
54cbc73031
Update setup_ubuntu-host_qemu-vm_x86-64-kernel.md 2020-06-29 15:00:45 +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
Tobias Klauser
344d949f1e vendor: bump golang.org/x/sys/unix
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-29 13:34:06 +02:00
Necip Fazil Yildiran
9befc2b603
executor: enable cgroup/cpuset memory pressure calc. (#1879)
Enable the cpuset.memory_pressure_enabled flag in the root cpuset.

Co-authored-by: Necip Fazil Yildiran <necip@google.com>
2020-06-29 12:27:09 +02:00