aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs
Commit message (Collapse)AuthorAgeFilesLines
* all: use `t.TempDir` to create temporary test directoryEng Zer Jun2022-03-281-16/+3
| | | | | | | | | This commit replaces all `ioutil.TempDir` with `t.TempDir` in tests. The directory created by `t.TempDir` is automatically removed when the test and all its subtests complete. Reference: https://pkg.go.dev/testing#T.TempDir Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* dashboard/app: show link to git commit for patch testingDmitry Vyukov2021-03-132-3/+50
|
* pkg/vcs: use gcc 10 for linux v5.9+Dmitry Vyukov2021-02-171-0/+2
| | | | | | All bisections started failing with: Compiler lacks asm-goto support. Use gcc 10 for v5.9+.
* pkg/vcs: allow sso protocol for git reposDmitry Vyukov2021-01-092-4/+5
|
* pkg/vcs: allow ~ in git repo URLsDmitry Vyukov2020-12-302-3/+4
|
* pkg/vcs: reorder codeDmitry Vyukov2020-12-251-50/+50
| | | | | Recipients is not the most importnat part of the vcs interface, move it from the very top closer to the bottom.
* pkg/vcs: add repo.Contains methodDmitry Vyukov2020-12-254-0/+42
| | | | | | Returns true if the current tree contains the specified commit (the commit is reachable from the current HEAD). Cntains(commit string) (bool, error)
* pkg/kconfig: store minimization resultsJouni Hogander2020-12-105-25/+21
| | | | | Store config options identified using DebugTracer. Also change bisection and configuration minimization code to use new DebugTracer.
* tools/syz-bisect: use vcs.HEAD by defaultJouni Hogander2020-12-101-0/+2
| | | | Use vcs.HEAD if syzkaller or kernel commit is not given
* pkg/vcs: use --force with git fetchDmitry Vyukov2020-12-101-3/+3
| | | | | | | | | | | | | | git fetch can fail due to force-recreated tags: > ! [rejected] ext4_for_linus -> ext4_for_linus > (would clobber existing tag) And due to something related to updating local branches (see 'git help fetch' for details). --force should avoid both issues and it seems that we always want force for our purposes (rather than fail update/patch testing).
* tools/syz-reprolist: don't drop syzkaller repo on errorsDmitry Vyukov2020-11-241-2/+2
|
* pkg/vcs/git: optimize CheckoutBranchAlexander Egorenkov2020-11-201-1/+4
| | | | | | | | | | | | | | | | | Fetching a remote branch w/o the corresponding remote with git disables delta optimization on the server's side and the git client is forced to download the complete branch even if it already has got an older version. This leads to several problems as: * Long fetch time * Limitless growth of local git repo due to git fetch creating a new pack file every time Create a remote before fetching to fix the above issues. With a remote, only the first fetch will take some time and all the following ones shall be very fast. Furthermore, git fetch will avoid creating many pack files in .git/objects/pack. Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
* tools: add script to check shebang lines (#2234)Mark Johnston2020-11-022-54/+1
| | | | | | | | | | | * pkg/vcs: remove obsolete test script Per Dmitry, this should have been removed as part of 8f58e4b ("pkg/bisect: switch to kconfig.Minimize"). * all: convert shebang lines to use /usr/bin/env * Makefile: fix non-portable use of find(1)
* pkg/kconfig: accept target when parsing KconfigDmitry Vyukov2020-10-293-4/+8
| | | | | | Kconfig depends on the target arch. Add target argument for Kconfig parsing. Resolve $(SRCARCH) properly (previously we always assumed x86_64).
* tools/syz-kconf: detect -rcN tagsDmitry Vyukov2020-10-296-19/+63
| | | | | | We currently detect v5.10-rc1 as v5.9 because we ignore -rc tags. This makes it impossible to enable configs that were already added for v5.10. Treat v5.10-rc1 as v5.10 already.
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-7/+8
| | | | | | | | | | | | We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
* pkg/bisect: switch to kconfig.MinimizeDmitry Vyukov2020-10-213-276/+21
| | | | | | | | | | | | | | | Use the new kconfig.Minimize for config minization instead of the config-bisect.pl script. This is mostly just deleting code. Also update tests: - minimization is now supposed to test the baseline config (update "testos" stub accordingly) - minimization is not supposed to return a config that does not build (a reasonable config minimization procedure can't arrive to such config), remove test that tests this Update #2171
* pkg/vcs: refactor linuxAlterConfigsDmitry Vyukov2020-10-211-24/+35
| | | | | | | Use pkg/kconfig to make changes to .config. We now have slightly more civilized way of messing with configs. Update #2171
* pkg/vcs: fix testDmitry Vyukov2020-10-211-1/+3
| | | | | | | | Minimization must call the predicate (otherwise how does it know this config triggers the crash?). This does not matter now, but will matter in future. Update #2171
* pkg/vcs: add repo OptPrecious and OptDontSandbox optionsDmitry Vyukov2020-10-2111-86/+74
| | | | | | | | | | The pkg/vcs code assumed that we fully manage the repo within an autonomous program. In particular it tried to repair any errors by dropping and re-creating the repo. This does not work well for command-line tools that work with a user-provided repo. Add OptPrecious for such uses. Update #2171
* pkg/vcs: add ReleaseTagDmitry Vyukov2020-10-217-20/+36
| | | | | | | Add ReleaseTag method that returns last release tag for the given commit. Update #2171
* pkg/vcs: use committer dateTetsuo Handa2020-10-103-5/+17
| | | | | | | | The Freshness columns in Instances: table on the dashboard page look outdated, for these fields are showing when that patch was authored. Where possible, using when that patch was committed into the tree in question would be more meaningful. Update #1537
* pkg/vcs: disable BLK_DEV_INITRD configJouni Hogander2020-10-091-0/+4
| | | | | | | | | This config is causing problems to kernel signature calculation. New initramfs is generated as a part of every build. Due to this init.data section containing this generated initramfs is differing between builds causing signture being random number. Signed-off-by: Jouni Hogander <jouni.hoegander@partner.bmw.de>
* pkg/vcs: support git URL starting with file:///Alexander Egorenkov2020-10-022-2/+7
| | | | | | For use inside a Docker container e.g. Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
* pkg/vcs: disable UBSAN before v5.3Dmitry Vyukov2020-09-281-0/+3
| | | | | | | UBSAN is broken in multiple ways before v5.3, see: https://github.com/google/syzkaller/issues/1523#issuecomment-696514105 Update #1523
* pkg/bisect: add ccache optionJouni Hogander2020-09-211-0/+1
| | | | | | Add option to use ccache in kernel builds. Signed-off-by: Jouni Hogander <jouni.hoegander@partner.bmw.de>
* pkg: get and store Maintainers dataPedro Lopes2020-07-316-27/+145
| | | | | | 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.
* all: fix comments formatDmitry Vyukov2020-07-122-4/+4
| | | | | | | Fix capitalization, dots at the end and two spaces after a period. Update #1876
* pkg/vcs: don't sandbox syzkaller repoDmitry Vyukov2020-07-122-11/+22
| | | | | | | | | | | | | | | | | | | 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.
* pkg/vcs: fix config bisection tests moreDmitry Vyukov2020-07-073-2/+11
| | | | | | | | | | | 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.
* pkg/vcs: fix config bisection testDmitry Vyukov2020-07-071-1/+1
| | | | | | /bin/bash is usually installed on linux'es, but not on other OSes, e.g. *BSDs. Use /bin/sh instead of /bin/bash.
* pkg/vcs: fix config minimization testDmitry Vyukov2020-07-071-45/+52
| | | | | | | | | | | 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.
* all: fix dup types in func argsDmitry Vyukov2020-07-041-1/+1
|
* pkg/vcs: reset state even moreDmitry Vyukov2020-07-041-1/+2
| | | | | | "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.
* pkg/bisect: improve config minimization testsDmitry Vyukov2020-07-021-2/+8
| | | | | | | 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.
* pkg/bisect: move checking of minimized config into common codeDmitry Vyukov2020-07-022-16/+0
| | | | | 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.
* pkg/bisect: minor style fix upsDmitry Vyukov2020-07-023-149/+77
|
* pkg/bisect: Implement config bisectionJouni Hogander2020-07-026-1/+454
| | | | | | | | | 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.
* .golangci.yml: reenable dupl checkerDmitry Vyukov2020-06-051-49/+23
| | | | | At some point it was enabled, but then somehow got disabled. Re-enable and fix some regressions.
* pkg/vcs: run git clean with switching commitsDmitry Vyukov2020-05-251-0/+1
| | | | | Maybe it will help to fix: https://groups.google.com/forum/#!topic/syzkaller-bugs/2lgvlHd8t1c
* pkg/vcs: always extract tags from subjectDmitry Vyukov2020-05-182-15/+12
|
* pkg/vcs: Fix golangci-lint formatting errorPaul Chaignon2020-04-061-3/+4
| | | | | | | | pkg/vcs/vcs.go:186:2: var `gitSshRepoRe` should be `gitSSHRepoRe` gitSshRepoRe = regexp.MustCompile(`^(git|ssh|http|https|ftp|ftps)@[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+(:[a-zA-Z0-9-_]+)?(/[a-zA-Z0-9-_./]+)?(/)?$`) ^ Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
* pkg/vcs: Support ssh git reposJukka Kaartinen2020-04-032-1/+6
| | | | Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
* dashboard/config: switch to ORC unwinderAndrey Konovalov2020-02-261-4/+19
| | | | | | | | | Jann pointed out that the frame pointer unwinder fails to unwind double fault stacks. Switch to using the ORC unwinder instead. https://www.kernel.org/doc/html/latest/x86/orc-unwinder.html Suggested-by: Jann Horn <jannh@google.com>
* tools: add script that checks copyright headersDmitry Vyukov2020-02-181-0/+3
| | | | Fixes #1604
* pkg/vcs: disable CONFIG_DEBUG_KOBJECT during bisectionDmitry Vyukov2020-01-161-0/+5
| | | | | | | | We disabled it in configs, now also disable during bisection. This config only adds debug output. It should not be enabled at all, but it was accidentially enabled on some instances for some periods of time, and kernel is boot-broken for prolonged ranges of commits with deadlock which makes bisections take weeks.
* pkg/vcs: disable CONFIG_DEBUG_INFO_BTF during bisectionDmitry Vyukov2020-01-071-0/+4
| | | | | | BTF fails lots of builds with: pahole version v1.9 is too old, need at least v1.13 Failed to generate BTF for vmlinux. Try to disable CONFIG_DEBUG_INFO_BTF.
* pkg/vcs: Unset various git environment variables when invoking gitAndrew Donnellan2019-12-123-2/+32
| | | | | | | | | | | | | | | | 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>
* pkg/vcs: don't CC people on CC (sic)Dmitry Vyukov2019-12-102-3/+2
| | | | Update #1441
* pkg/report: use --git-min-percent=15 for get_maintainer.plDmitry Vyukov2019-12-101-2/+4
| | | | Update #1441