3810 Commits

Author SHA1 Message Date
Dmitry Vyukov
4e668495fb sys/syz-extract: fix too long line 2019-03-27 09:44:01 +01:00
Marco Vanotti
1174f0c1ec docs/fuchsia: update fx set & paths in docs
This commit updates the documentation for fuchsia, updating both the fx
set commands as well as the syz-manager config example.

The invocation for the fx set command changed recently. The new command
requires the user to specify both the product and board (core.x64 and
core.arm64), as well as the build directory (otherwise everything gets
built into `out/default`).

The changes in the syz-manager config are for it to point to the right
files required to run a fuchsia vm.
2019-03-27 09:33:53 +01:00
Marco Vanotti
70d776a21a sys/sys-extract: update import path for fuchsia.
Apparently, sysroot/include doesn't exist in the build-zircon path
anymore. I changed the path in sys-extract to make it point to the
exported sdk include path.

I also ran make extract and make generate to add new fidl definitions.

TEST=ran make extract and make generate.
2019-03-27 09:08:05 +01:00
Marco Vanotti
69e1a4f7d5 pkg/build: update fuchsia build commands.
This CL changes the invocation of the `fx set` command to match the new
format[0].

This change involves removing "board" and "product" flags. Instead, now one has to use
`fx set product.board` to get the same result. In the case of syzkaller,
this would be "core.${ARCH}" where arch could be x64 or arm64.

Also, the default build directory now is `out/default`, and for now, it
is still not possible to have multiple archs built altogether. I set the
build directory manually to `out/${ARCH}` (as was before). This would
allow syzkaller to also build the kernel for arm if required.

[0]: https://fuchsia.googlesource.com/fuchsia/+/b814211ab33eeb4e8f02962d5c81d042b2464ac7

TEST=Tested this in syz-ci. It worked.
2019-03-27 09:07:06 +01:00
Dmitry Vyukov
55684ce16b pkg/html: update generated file 2019-03-25 17:20:35 +01:00
Dmitry Vyukov
52a20ba400 dashboard/app: properly handle build failures
Separate kernel and syzkaller build failures.
Fix logic to understand when a build is fixed:
look if kernel/syzkaller commit changes to understand
if it's a new good build or re-upload of an old build.

Fixes #1014
2019-03-25 17:00:25 +01:00
Dmitry Vyukov
2c86e0a54a pkg/report: skip memmove on linux 2019-03-24 16:59:26 +01:00
Dmitry Vyukov
8e1b6f6446 dashboard/app: fix infinite emails
We override crash with the crash used for bisection
to make the information more consistent.
However if bisection crash only have syz repro
and there is now another crash with C repro,
then we always think that we have not reported C repro
and continue sending the same report again and again.
Don't override the crash with bisection crash in such case.
2019-03-24 12:52:30 +01:00
Shankara Pailoor
acbc5b7d05 sys/linux: move openat to dev_rtc.txt
move openat$rtc to rtc_dev and change return type to fd_rtc
2019-03-24 09:28:43 +01:00
Dongliang Mu
a2cef203ff tools/syz-execprog: remove dead code 2019-03-23 09:54:12 +01:00
Dmitry Vyukov
3361bde577 dashboard/app: import datastore as db
datastore is too long name for such widely used packages.
Import it as db throughout. Nicely reduces line lengths.
2019-03-22 15:11:26 +01:00
Dmitry Vyukov
6155cc0988 dashboard/app: mark managers as bad after 6 hours of inactivity
It should not take more than 6 hours to rebuild all kernels.
So it's better to highlight bad managers earlier.
2019-03-22 15:05:45 +01:00
Dmitry Vyukov
028c09511b pkg/bisect: detect when too many instances errored
We currently skip a commit iff all 10 instances errored.
But if, say, only 9 errored we consider it as OK,
but this significnalty reduces chances of detecting flaky crashes.
So skip if more than 2/3 errored.

Update #501
2019-03-22 12:56:42 +01:00
Dmitry Vyukov
9ad9ef29ca dashboard/app: slightly relax command parsing
Users have misspelled test: multiple times.
Accept commands without the colon.
2019-03-22 12:00:50 +01:00
Dmitry Vyukov
4d9d915eae syz-ci: fix filling of kernel commit in bisection jobs
There is a bit of a mess: dashboard expects the start commit
in build info, but syz-ci sends the resulting cause commit.
Moreover for inconclusive bisection the commit is not filled at all.
Fill start commit in build info on start.

Update #501
2019-03-22 12:00:50 +01:00
Dmitry Vyukov
8f92118cb6 pkg/vcs: disable CONFIG_CAN for bisection before v4.13
Update #501
2019-03-22 12:00:50 +01:00
Dmitry Vyukov
ca3ffbc9f3 dashboard/app: add uncc command
Add "#syz uncc" command as a safety handle.
The command allows sender to unsubscribe from all future communication on the bug.

Linus mentioned possibility of saying "I'm not the right person for this report"
in the context of bug reminders:
https://groups.google.com/d/msg/syzkaller/zYlQ-b-QPHQ/AJzpeObcBAAJ
2019-03-22 12:00:50 +01:00
Dmitry Vyukov
40fdabdc24 dashboard/app: add bisection link to emails
Add link to more information about bisection process
to emails that contain bisection results.
This seems to be a hot topic for questions.

Update #501
2019-03-22 12:00:50 +01:00
Dmitry Vyukov
dce6e62ffc
docs: add custom anchors to headers (2)
Div's seem to work. Use them.
2019-03-21 15:51:28 +01:00
Dmitry Vyukov
872db59363
docs: add custom anchors to headers (2)
The previous attempt made things only worse... Try 2.
2019-03-21 15:43:45 +01:00
Dmitry Vyukov
c94a70b7be
docs: add custom anchors to headers
Add shorter anchors that does not depend on actual text (subject to change).
This allows to generate shorter stable links to docs.
Let's see if this syntax works.
2019-03-21 15:28:50 +01:00
Dmitry Vyukov
7c9c9fd24f pkg/build: add a test for build failure root causing
Such error popped up during bisection on older kernels.
It's already detected properly, yet build failed with just "make failed"...
Unclear why that happened, but the test won't harm.

Update #501
2019-03-21 14:25:08 +01:00
Dmitry Vyukov
a9007a8ccb pkg/html: add reference for 12-char hashes in tags 2019-03-21 14:24:10 +01:00
Dmitry Vyukov
e6d1a816d8 pkg/csource: allow to ignore warnings during build
Running bisection using an older repro failed with:

    <stdin>: In function ‘syz_mount_image.constprop’:
    <stdin>:298:3: error: argument 1 null where non-null expected [-Werror=nonnull]
    In file included from <stdin>:26:0:
    /usr/include/x86_64-linux-gnu/sys/stat.h:320:12: note: in a call to function ‘mkdir’ declared here
     extern int mkdir (const char *__path, __mode_t __mode)

Let's be safe and ignore warnings during repro/bisect.
Everything that runs during tests still has all warnings.

Update #501
2019-03-21 13:30:12 +01:00
Dmitry Vyukov
44270612b4 executor: prevent non-null expected warnings
The added test triggers warnings like these:

<stdin>: In function ‘syz_mount_image.constprop’:
<stdin>:298:3: error: argument 1 null where non-null expected [-Werror=nonnull]
In file included from <stdin>:26:0:
/usr/include/x86_64-linux-gnu/sys/stat.h:320:12: note: in a call to function ‘mkdir’ declared here
 extern int mkdir (const char *__path, __mode_t __mode)
            ^~~~~
cc1: all warnings being treated as errors

<stdin>: In function ‘syz_open_procfs.constprop’:
<stdin>:530:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=]
<stdin>:85:110: note: in definition of macro ‘NONFAILING’
<stdin>:532:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=]
<stdin>:85:110: note: in definition of macro ‘NONFAILING’
<stdin>:534:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=]
<stdin>:85:110: note: in definition of macro ‘NONFAILING’

Use volatile for all arguments of syz_ functions to prevent
compiler from treating the arguments as constants in reproducers.

Popped up during bisection that used a repro that previously worked.
Update #501
2019-03-21 13:27:41 +01:00
Dmitry Vyukov
2dadc32780 Makefile: fix tidy rule
Building executor now requires GOOS/GOARCH macros.
2019-03-21 12:30:53 +01:00
Dmitry Vyukov
f6094a8c64 dashboard/app: use 12-char hash in Fixes tags
@ebiggers pointed out that Fixes tags should use 12-char hash:
https://groups.google.com/d/msg/syzkaller-bugs/yUhRrLD6T6A/3TMwOWvWAgAJ
I can't find any documentation on this, but it looks like most
existing tags follow this convention so use 12-char hashes.
2019-03-21 09:32:46 +01:00
Marco Vanotti
2cc9698b58 pkg/vcs: fix fuchsia's git repo directory.
This commit changes the fuchsia git repo to make it point to the main
repo instead of just "zircon".

Previously, zircon had its own git repo, so syzkaller had a wrapper that
would issue jiri commands for the whole fuchsia repo, but would just
report commits in the zircon repo.

Recently, fuchsia merged most of its repositories in just one big git
repo. So now, zircon is part of the fuchsia git repo. I think the code
continued working because the old zircon repo is still part of a git
repository, so git commands worked there.

The new code now doesn't have any special casing for Zircon, and now
(almost) everything is part of the fuchsia repo. The other repos are now
git submodules.
2019-03-21 09:10:48 +01:00
Mark Johnston
427ea48700 pkg/report: deduplicate sctp "no chunks on the queues" reports 2019-03-20 17:46:29 +01:00
Dmitry Vyukov
a664c187e4 syz-ci: fix a typo 2019-03-20 13:55:56 +01:00
Dmitry Vyukov
a469d047d1 pkg/vcs: fix git tag --points-at invocation
Turns out older versions of git don't imply --list for --points-at and fail.
So add --list explicitly.

Update #501
2019-03-20 13:55:48 +01:00
Dmitry Vyukov
6477d5172f syz-ci: improve job loop logic
1. Prevent grabbing the next job on stop with 50% probability.
2. Don't claim jobs if another build is already in progress.

Update #501
2019-03-20 12:20:54 +01:00
Dmitry Vyukov
142c38ee4d dashboard/app: request test/bisect jobs separately
Allow separate sets of managers for patch testing and for bisection.
This makes things more flexible on syz-ci deployment side.
Remove previous hacks for bisection deployment.

Update #501
2019-03-20 12:00:34 +01:00
Dmitry Vyukov
042e4d5419 pkg/bisect: use CheckoutCommit instead of SwitchCommit
Use CheckoutCommit instead of SwitchCommitto get the crashing commit.
The problem is with trees like linux-next. They require at least fetching tags
and maybe even different tree (-history).
Use CheckoutCommit which at least fetches tags which is enough
for recent commits.

Update #501
2019-03-20 11:01:12 +01:00
Dmitry Vyukov
5f5191b43f pkg/vcs: wrap git invocations in a helper method
There is a bunch of repetition to invoke git.
Wrap it into a helper method.
2019-03-20 11:01:00 +01:00
Dmitry Vyukov
d4aacfdb59 pkg/vcs: remove unused functions
Bisect is not needed after introduction of Bisecter interface.
2019-03-20 10:34:16 +01:00
Marco Vanotti
b97faf8e7a executor: update fdio import path
The Fuchsia team is going to remove the `lib/fdio/util.h` library. They
have already moved all the functions to new header files.

I have seen that fuchsia uses `fdio_service_connect`, which has been
moved to the `lib/fdio/directory.h` header file.

This commit just changes the import path in the fuchsia executor, and in
the corresponding generated go file (I made that change by running `make
generate`).
2019-03-20 07:52:40 +01:00
Marco Vanotti
14799fb2ef docs, pkg/vcs, sys/fuchsia: update fuchsia urls
Recently the fuchsia team decided to merge all their subrepos into one
big git repo. This meant that the "zircon" repo doesn't exist anymore.
Instead almost everything is under the fuchsia repo.

This change updates all the reference I could find in the code that
point to the zircon and docs repo to make them point to the new fuchsia
repo.
2019-03-20 07:50:58 +01:00
Andrew Donnellan
54779150a6 syz-manager: fix typo in dashboard stats upload error
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
2019-03-20 07:47:17 +01:00
Mark Johnston
2458c1c6c2 pkg/report: fix matching for traps in kernel mode
We already have a pattern to match "Fatal trap N: ..." panics, but the
format of our backtraces has changed since it was added.  Add another
pattern which correctly matches a few instances generated by syzbot.
2019-03-19 18:45:18 +01:00
Dmitry Vyukov
3f1c29d938 dashboard/app: report bisection results to external reporting
Update #501
2019-03-19 16:37:21 +01:00
Dmitry Vyukov
28c04d39e0 sys/linux: disable SYSLOG_ACTION_CLEAR
For context see:
https://groups.google.com/d/msg/syzkaller/8nUJCnMfark/y8HOM_vrCQAJ
2019-03-19 14:33:45 +01:00
Mark Johnston
e454923488 pkg/build: copy kernel.full to the objdir after a build
This helps ensure that we can create coverage reports on FreeBSD.
2019-03-19 10:26:46 +01:00
Mark Johnston
0dbba7ad6c sys/targets: use kernel.full instead of kernel.debug
The latter contains only debug symbols and is meant to be used with the
kernel executable.  That is, the kernel executable contains a
.gnu_debuglink pointer to kernel.debug.  kernel.full contains
everything, including a copy of the kernel's text section, which we want
when enumerating __sanitizer_cov_trace_pc() calls for a coverage report.
2019-03-19 10:26:46 +01:00
Dmitry Vyukov
46264c3259 dashboard/app: fix a typo in comment 2019-03-18 13:39:52 +01:00
Dmitry Vyukov
61f9c92f3a sys/linux: restrict SYSLOG_ACTION_CONSOLE_LEVEL
Fuzzer must not mess with console, turn it on/off, change log level, etc.
Otherwise it turns off kernel output on console.
2019-03-18 13:35:11 +01:00
Dmitry Vyukov
13026d10f0 dashboard/config: add freebsd service script 2019-03-18 12:41:16 +01:00
Dmitry Vyukov
bdb7b93f25 pkg/osutil: kill subprocesses more reliably
In some cases we start scp, which starts ssh,
then kill scp but the ssh subprocess is not killed.
As the result cmd.Wait hangs waiting for EOF on the stdout/stderr,
which are still kept alive by ssh subprocess. But ssh just hangs forever.

Create a process group for each command and kill whole process group.
Hopefully this will help.
2019-03-18 10:52:18 +01:00
Dmitry Vyukov
08db11409e dashboard/app: make email tests more interesting
1. Mail bugs for second and third reportings to different emails
   so that it's possible to distinguish where they are actually mailed.
2. Add bisection test where we skip bug in the second reporting.
   Bisection results should go straigth to third as well.
2019-03-18 09:51:33 +01:00
Anton Lindqvist
4656becafb sys/openbsd: add chflags descriptions 2019-03-18 08:52:35 +01:00