Commit Graph

268 Commits

Author SHA1 Message Date
Dmitry Vyukov
fa763482c3 dashboard/app: add admin page
Add /admin page and move logs, jobs, manager onto it.
The main page is too overloaded and takes too long to load.
We need to start splitting it. This is a first step.
2019-04-05 17:56:42 +02:00
Dmitry Vyukov
698a192c6d dashboard/app: don't error on invalid emails
Malformed emails constantly appear from spammers.
But we have not seen errors parsing legit emails.
These errors are annoying. Warn and ignore them.
2019-03-29 08:56:02 +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
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
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
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
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
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
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
3f1c29d938 dashboard/app: report bisection results to external reporting
Update #501
2019-03-19 16:37:21 +01:00
Dmitry Vyukov
46264c3259 dashboard/app: fix a typo in comment 2019-03-18 13:39:52 +01:00
Dmitry Vyukov
13026d10f0 dashboard/config: add freebsd service script 2019-03-18 12:41:16 +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
Dmitry Vyukov
bcbe71c80a dashboard/app, syz-ci: bisection support
This adds bulk of support for bisection to dashboard/app and syz-ci:
- APIs to send bisection jobs and accept results
- syz-ci logic to execute bisection jobs
- formatting of emails with results
- showing of results on dashboard

Some difficulties we have to overcome:
- since linux is frequently build/boot broken, lots of bisections are inconclusive,
  need to present such results too
- git bisect is poorly suitable for automation, have to resort to output parsing (is output stable?)
- git bisect turns out to fail (exit with non-0 status) when bisection is inconclusive
  (multiple potential cause commits)
- older syzkaller revisions can't be built with newer (broken) kernel header, e.g.:
  ebtables.h:197:19: error: invalid conversion from ‘void*’ to ‘ebt_entry_target*’
- newer compilers produce more warnings and break old syzkaller builds, e.g.:
  kvm.S.h:6:12: error: ‘kvm_asm64_vm86’ defined but not used [-Werror=unused-const-variable=]
- figuring relevant emails to CC from a commit is non-trivial:
  besides commit author, there can be some emails in commit tags, or not,
  which tags to use is an interesting question (some may include irrelevant emails)
  we can also run get_maintainers.pl on the commit, but this can produce too wide
  list if commit touches lots of files, it can also produce too small list,
  and then we need to resort to blame
- for inconclusive bisection we probably don't need to include emails referenced
  in the commits (there can be too many of these commits)
- need to be careful to exclude own syzbot email from commit CC list,
  now syzbot emails are referenced in some commits (Reported-by/Tested-by/etc)
  (can cause some kind of infinite recursion)
- lots of commits reference stable mailing list,
  we should not include it in CC because it's referenced for backports rather then bug reports
- since we add new Bug entity fields which we use in queries,
  whole datastore need to be upgrades to add the new field to index
- we must not discard the crash that was used for bisection
  (treat it as a reported crash)
- bisection results need 2 forms of reports:
  one when we add bisection results to already reported bug
  another when we report a bug first time with bisection results
- when reporting a bug with bisection results we need to use the crash
  that was used for bisection
- some fraction of bisections will probably fail with various errors
  and we will need some mechanism to retry bisection after the root cause is resolved
  this is not implemented yet
- linux-next is problematic for 2 reasons:
  fix bisection can't possibly run on linux-next as commits are not reachable from HEAD
  lots of commits are missing in linux-next (even in linux-next-history)
  e.g. we have some c63e9e91a254a52 which is now missing in linux-next/linux-next-history
- older kernels can't be build with fresh gcc/binutils/perl/make/glibc
  for now we have to stop at v3.9 (this only requires switching gcc several times along the way)
- kernels past v4.11 do not build with gcc 7 and 8 (undefined reference to `____ilog2_NaN')
- v4.1 and back have only compiler-gcc5.h
- v3.17 and back have only compiler-gcc4.h
- v3.6 and back do not have make olddefconfig
- compat socket calls can't be bisected past "x86/entry/syscalls: Wire up 32-bit
  direct socket calls" (v4.10) because of
  https://syzkaller.appspot.com/bug?id=b5b150e322d5f48c869bcf1528cdbee08d1421cb
- v2.6.28 and below does not work with modern make:
  *** mixed implicit and normal rules: deprecated syntax
- v3.8 build fails:
  Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
  kernel/Makefile:134: recipe for target 'kernel/timeconst.h' failed
- make 3.81 works for v2.6.28.
  3.81 almost works with current HEAD, you need to run make twice because first run spuriously fails with:
- v2.6.28 with gcc-4.9.4 broken with:
  include/linux/kvm.h:240:9: error: duplicate member ‘padding’
- but even defconfig fails:
  VDSO    arch/x86/vdso/vdso.so.dbg
  gcc: error: elf_x86_64: No such file or directory
  gcc: error: unrecognized command line option ‘-m’
  It seems that we also need old binutils.
- for v3.8 and below we need perl-5.14.4.
  Unfortunately this or any manually built perl doesn't work for later kernels:
  Can't locate strict.pm in @INC
- kernels starting from 4.14 and older are boot broken:
  https://lkml.org/lkml/2018/9/7/648
- kernels older than 4.12 are broken during netdev setup
  (fixed by commit 675c8da049fd6556eb2d6cdd745fe812752f07a8)

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
03efedc6d1 dashboard/app: add handler for config migration
updateBugReporting adds missing reporting stages to bugs in a single namespace.
Use with care. There is no undo.
This can be used to migrate datastore to a new config with more reporting stages.
This functionality is intentionally not connected to any handler.
Before invoking it is recommented to stop all connected instances just in case.
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
5900c53a4d dashboard/app: make dashapi.BugReport more self-contained
Extend BugReport with few fields that are needed by all reportings anyway.
This allows to not create and fill an almost identical object to pass to template.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
ded8ff151d dashboard/app: load crash in loadJob test helper
Will be useful for bisection testing.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
d7e03ecccc dashboard/app: use pkg/html to format text emails
Use pkg/html helpers to format text emails.
Shorten short hashes to 8 char while we are here,
the length used by git log --oneline.
Tidy up tests a bit.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
5cf6e34d9e dashboard/app: add markCrashReported helper
Factor out markCrashReported out of incomingCommandTx.
Use it when creating patch testing jobs.
Will be needed for bisection jobs as well.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
d543ef9137 dashboard/app: add Log text entity
To store bisection logs.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
c871758a71 dashboard/app: rename CommitInfo to Commit
Because why?
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
5958caeafc dashboard/app: modernize tests
Use expectOK for checking errors more.
Use pollEmailBug helper more.
Add expectNE and use it.
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
8c085c5e4a
dashboard/app: add README.md
Update #1043
2019-03-07 09:27:51 +01:00
Greg Steuck
16559f86f5
ci-openbsd-multicore: enable PF (#1033)
* pkg/build/openbsd: copy overlay files from userspaceDir into image

Fixes #1030
2019-03-05 09:08:17 -08:00
Dmitry Vyukov
2e1b81398b dashboard/app: extend email reply when bug is not found
We currently reply with a very minimalistic reply that is not too actionable.
Explain what exactly happened and how to fix it.
2019-02-26 16:27:33 +01:00
Dmitry Vyukov
7a06e79212 dashboard/app: don't show empty compiler/CC
Compiler and CC can be empty, don't show them if they are empty.
2019-02-23 19:22:17 +01:00
Dmitry Vyukov
6a5fcca423 dashboard/app: implement bug notifications/actions
Currently dashboard can only report new bugs and add reproducers
to already reported bugs.
This change adds infrastructure for the dashboard to actively act
on existing bugs in different ways. 4 new notifications (actions) added:
 - dashboard can auto-upstream bugs from moderation after an embargo period
 - dashboard can auto-upstream bugs if reporting criteria changes
   (e.g. it reported a bug into moderation because there was no repro,
   but then repro appears and the bug is automatically sent upstream)
 - dashboard detects when a fixing commit does not appear in any tested trees
   for too long and sends a notification about this
 - dashboard detects stale bugs (last happened monts ago, no repro, no activity)
   and auto-invalidates them
This will also be useful to send pings for old bugs and do other automation.
2019-02-22 11:42:54 +01:00
Dmitry Vyukov
4df543c9ab dashboard/app: remove ReportingType.NeedMaintainers
Instead require DefaultMaintainers if MailMaintainers is set.
This makes logic in needReport a bit simpler.
2019-02-19 15:23:49 +01:00
Dmitry Vyukov
6a4471c2e5 dashboard/app: fix unused variable warning
isAppEngineTest is meant to be used in prod configs.
2019-02-17 15:44:21 +01:00
Dmitry Vyukov
3e98cc3080 dashboard/app: poll commits info
This implements 2 features:
 - syz-ci polls a set of additional repos to discover fixing commits sooner
   (e.g. it can now discover a fixing commit in netfilter tree before
   it reaches any of the tested trees).
 - syz-ci uploads info about commits to dashboard.
   For example, a user marks a bug as fixed by commit "foo: bar".
   syz-ci will find this commit in the main namespace repo
   and upload commmit hash/date/author to dashboard. This in turn
   allows to show links to fixing commits.

Fixes #691
Fixes #610
2019-02-17 15:08:45 +01:00
Dmitry Vyukov
76dd003f1b dashboard/dashapi: remove unused type
Stray change in the previous commit.
This unbreaks CI build.
2019-02-14 10:36:24 +01:00
Dmitry Vyukov
6a46f448c4 dashboard/app: remove unused function 2019-02-13 16:41:04 +01:00
Dmitry Vyukov
0f51729bc4 dashboard/app: record last activity and fix times
It would be useful to record last activity time for bugs
(e.g. for pings) and when a fix is provided for statistics purposes.

Fixes #673
2019-02-13 15:58:42 +01:00
Anton Lindqvist
d75f7686f1 dashboard/config: enable WITNESS_LOCKTRACE on OpenBSD (#987)
This option will print all lock acquisition paths once a lock violation
is identified by witness[1].

[1] https://marc.info/?l=openbsd-cvs&m=154955230813384&w=2
2019-02-09 07:27:06 -08:00
Dmitry Vyukov
ffec3d1894 dashboard/config: add lsm= cmdline arg for stacked modules
It won't take effect right now as security= has precedence over lsm=.
But it won't harm too and later we will only need to remove security=.
Also it will work with this custom patch for syzbot:
https://groups.google.com/d/msg/syzkaller/BSgVCTSShRQ/E6lFuiDpFwAJ

Update #973
2019-02-01 19:43:52 +01:00
Dmitry Vyukov
aa53be276d dashboard/config: prepare for stacked security modules
In linux-next security modules can be stacked.
TOMOYO is compatible with other modules and SAFESETID
module is added. But this is not yet in mainline.

Enable TOMOYO and SAFESETID.
There is no way to enable stacked modules in linux-next
while preserving the current behavior in mainline.
Once these changes reach mainline, we will need to replace
security cmdline arguments with lsm as follows:

lsm=yama,safesetid,integrity,selinux,tomoyo
lsm=yama,safesetid,integrity,smack,tomoyo
lsm=yama,safesetid,integrity,tomoyo,apparmor
2019-02-01 11:00:59 +01:00
Anton Lindqvist
ce1ccf9723 dashboard/config: enable witness on OpenBSD
Lets give this another try now that larger kernels can boot.
2019-01-24 07:38:43 +01:00
Dmitry Vyukov
7da2392541 pkg/report: support CONFIG_PRINTK_CALLER
CONFIG_PRINTK_CALLER has reached linux-next:
https://groups.google.com/d/msg/syzkaller/xEDUgkgFvL8/d5bBS3BJBwAJ

Enable CONFIG_PRINTK_CALLER and support parsing of its output format.

This gives us several advantages:
 - output from different contexts don't intermix
 - intermixed output doesn't cause corrupted reports
 - we can keep larger prefix since we know it comes from the same task

Credit for the kernel part goes to Tetsuo Handa.
Also Sergey Senozhatsky and Petr Mladek for reviews of the kernel part.

Fixes #596
Fixes #600
2019-01-03 19:23:07 +01:00
Anton Lindqvist
752613e615 dashboard/config: enable LOCKF_DIAGNOSTIC on OpenBSD 2019-01-03 09:29:12 +01:00
Eric Biggers
f0491811f9 dashboard/config: enable more linux crypto configs 2019-01-02 11:24:46 +01:00
Dmitry Vyukov
6b761be059 dashboard/config: enable more linux net configs
Enable some BT/RXRPC/MAC80211/ISDN configs.
2018-12-29 19:22:34 +01:00
Dmitry Vyukov
c87e9eb9bd dashboard/config: enable HSR and NUMA_EMU 2018-12-26 18:24:53 +01:00
Dmitry Vyukov
309bb18442 dashboard/config: moar networking configs
Add more x25 drivers, wlan, slip, caif and other stuff that I don't understand,
but syzkaller can potentially reach.
2018-12-24 18:56:06 +01:00
Dmitry Vyukov
dd61e58d94 sys/linux: extend AX25/ROSE/NETROM descriptions 2018-12-24 18:56:06 +01:00
Dmitry Vyukov
b025ab82d2 dashboard/config: enable more net configs
Enable some more net configs that we can potentially reach.
Update to latest kernel.
2018-12-24 09:59:56 +01:00
Greg Steuck
a8b6d1af46 pkg/build/openbsd: always make clean to manage config in tree
clean build barely takes 3 minutes end-to-end on our CI machine.

Undo debug options which caused prevented kernels from booting on GCE.
2018-12-19 17:15:31 +01:00
Greg Steuck
67c1ac5222 dashboard/config: store kernel configs in tree
* sus/openbsd: store kernel configs in tree

They now include https://man.openbsd.org/witness per suggestion from
@mptre

* LOCKF_DIAGNOSTIC while we are at it.

* Moved to a better place.
2018-12-18 10:35:29 +01:00