21 Commits

Author SHA1 Message Date
Pedro Lopes
242b0eb219 pkg: get and store Maintainers data
Create a struct on pkg/vcs to store data of syzkaller email recipients
and update its users. The struct contains default name, email, and a
label to divide user into To and Cc when sending the emails.
2020-07-31 17:18:29 +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 8eda0b957e5b
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
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
30927cd7ca pkg/vcs: run git clean with switching commits
Maybe it will help to fix:
https://groups.google.com/forum/#!topic/syzkaller-bugs/2lgvlHd8t1c
2020-05-25 14:42:46 +02:00
Dmitry Vyukov
684d36068d pkg/vcs: always extract tags from subject 2020-05-18 12:59:59 +02:00
Andrew Donnellan
08003f6440 pkg/vcs: Unset various git environment variables when invoking git
If you try to run git-using tests while the GIT_DIR environment variable
(and GIT_WORK_TREE, etc) happens to be set, the tests are going to do fun
and exciting things on a repository that isn't the test repository it tries
to set up.

As it turns out, if you try to run "make test" using git rebase -x, you'll
end up with GIT_DIR set to the syzkaller tree. Hilarity ensues.

Unset GIT_DIR, GIT_WORK_TREE and a few other environment variables when
invoking git - that way it'll default to looking at the working directory
that we have given it, which is what we expect.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
2019-12-12 09:56:25 +01:00
Dmitry Vyukov
6f7be11fa1 dashboard/app: don't report bisections pointing to release commits
They should have been detected by "same binary" logic.
But the problem is that we may use different compilers
for different commits and they switch exactly at release commits.
So we can build the release with a differnet compiler than the
rest of commits and then obviously it won't be "same binary".
Detect release commits separately.

Update #1271
2019-11-27 14:05:14 +01:00
Dmitry Vyukov
30cb7f98cd pkg/bisect: detect wrong bisections
Detect bisection to merge commits and to commits that don't affect
kernel binary (comments, other arches, whitespaces, etc).
Such bisections are not reported in emails (but shown on web).

Update #1271
2019-11-07 11:07:03 +01:00
Zubin Mithra
a2bdbd8c37 pkg/bisect: add initial testing support for cause bisection
(note: incomplete change)

Refactor existing code as follows:
* Move reusable test utility functions from git_repo_test.go to
pkg/vcs/test_util.go and make them exported.
* Split Run() into Run()+runImpl().
* Change type of bisect.go:env.inst to `instance.BuilderTester`.
Change usage inside syz-testbuild/testbuild.go accordingly.
* Move most of linux.PreviousReleaseTags() into vcs/git.go as
git.previousReleaseTags().
* Allow build.CompilerIdentity to be mocked.

Introduce the following changes:
* instance.BuilderTester is an interface with methods
	BuildSyzkaller()
	BuildKernel()
	Test()
NewEnv() now returns this interface.
* type testEnv implements instance.BuilderTester.
* type testBuilder implements builder interface. Add a entry into table
inside pkg/build/build.go:getBuilder() to return testBuilder object.
2019-10-22 10:09:57 +02:00
Anton Lindqvist
aac00cc3db pkg/vcs: handle git commits without a body
OpenBSD uses cvs and does not enforce the standard Git convention for
commit messages of putting a summary followed by a new line and body.
If such commit[1] contains a `Reported-by` header, it's currently not
detected. Instead, if the body is empty try to extract data from the
commit summary.

[1] bdbfbec5ce
2019-09-24 10:43:57 +02: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
1f6fc9f188 pkg/vcs: reset repo more
If we cherry-pick some fixes during bisection
we need to "git reset" repo before "git bisect reset".
Otherwise it will fail. Reset repo in more points.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
5ed211ca96 pkg/vcs: refactor bisection support
In preparation for syz-ci bisection:
- move bisection function into a separate interface
  they look out of place in vcs.Repo because most OSes
  don't implement it and most users don't case
- extract author name and more CC emails for commits
- move linux-specific PreviousReleaseTags into linux.go
- fix inconclusive bisection (more than 1 potential commits)
- add tests fr bisection
- add maintainers returned from get_maintainers.pl for commits
  that don't have enough emails (e.g. only author email)

Update #501
2019-03-17 18:06:44 +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
0127e3baa7 pkg/vcs: fetch git tags when checking out particular commit
Fetch of a named remote does not seem to fetch all tags.
This is a problem for linux-next as it contains lots of tags
that are not on the main branch because of periodic rebases.
2019-01-04 15:00:58 +01:00
Dmitry Vyukov
61adbb167e pkg/vcs: don't use --no-tags when fetching git
pkg/bisect uses Poll and then relies on tags for compiler detection.
Don't use --no-tags when fetching.

Update #501
2018-12-17 19:08:52 +01:00
Dmitry Vyukov
ce6744512e pkg/vcs: fix fetching of commits on non master branch
Fixes #728
2018-12-16 16:18:06 +01:00
Dmitry Vyukov
472947468d pkg/vcs: add openbsd support
This just says that we want to use git to checkout OpenBSD
without any special/complex features.

Update #712
2018-09-11 14:47:38 +02:00
Dmitry Vyukov
919e77001d pkg/vcs: add fuchsia support
For now only checking out and polling.
2018-06-27 14:56:46 +02:00
Dmitry Vyukov
58e8587f64 pkg/vcs: pave way for multi-vcs support
Wrap current git interface in abstract interface.
Provide constructor that create repo interface for the given os/vm.
2018-06-27 13:57:21 +02:00
Dmitry Vyukov
43da5e3a1b pkg/vcs: move from pkg/git
Rename pkg/git to pkg/vcs because we need to support not only git.
2018-06-27 13:07:03 +02:00