aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs/linux.go
Commit message (Collapse)AuthorAgeFilesLines
* all: apply linter auto fixesTaras Madan2025-07-171-5/+7
| | | | ./tools/syz-env bin/golangci-lint run ./... --fix
* pkg/vcs: use clang-15 for builds up to v6.15Aleksandr Nogikh2025-04-241-2/+4
| | | | | Otherwise we need to backport too many fix commits to address build/boot errors.
* all: use min/max functionsDmitry Vyukov2025-01-171-3/+1
| | | | They are shorter, more readable, and don't require temp vars.
* pkg/vcs: export GitWrapperAleksandr Nogikh2025-01-091-9/+9
| | | | | | | | | | | | | The current common vcs interface and its implementations are designed to support a very big number of situations (git modules, cleaning up complex state, etc), which is too heavy and restrictive when we just need a thin wrapper over the git command that supports a few basic operations. Refactor pkg/vcs to split out the wrapper code from the big git implementation of the vcs.Repo interface. Export the wrapper to enable reuse in other parts of the system.
* sys/targets: add consts for gvisor/starnixDmitry Vyukov2024-05-271-1/+1
| | | | | Lint started warning about duplicate "gvisor" const in pkg/cover. Add gvisor/starnix consts to sys/targets package to avoid duplication.
* pkg/bisect: make bisection more robustSimone Weiß2024-03-181-2/+7
| | | | | | | Bisection should not fail if the Kconfig or the baseline config have issues. Broken kernel sources might lead to issues when parsing Kconfig, ignore this and proceed with the original config. If the baseline config is not parseable, proceed anyway as this is an optional parameter to begin with.
* pkg/vcs: make git fetch calls more specificAleksandr Nogikh2024-01-171-1/+1
| | | | | | | | | This should make syzkaller only fetch the commits relevant for further processing. Also, specifying the exact commit/branch name to fetch allows us to access commits from custom refs. Test the new behaviour and double-check that remote tags fetch was not broken.
* pkg/bisect: test a subset of releasesAleksandr Nogikh2023-08-251-24/+8
| | | | | | | | | | For older bugs (or for bugs on stable trees), our cause bisection strategy times out while trying to iterate over all reachable tags. Try to be smarter and only take a subset of them, thus limiting the time we spend detecting the bug-free release. Closes #3376.
* pkg/vcs: ensure config transformation in predicatesAleksandr Nogikh2023-07-261-2/+8
| | | | | | The transform() call is assumed to be idempotent, so let's also run it before all predicate runs. It will ensure that we return exactly the same config from getConfig() as the one that was actually tested.
* all: use special placeholder for errorsTaras Madan2023-07-241-1/+1
|
* syz-ci: specify per-manager bisection backportsAleksandr Nogikh2023-07-201-1/+2
| | | | | | | | It might be the case that the kernels that are being fuzzed on syz-ci require their own backports to build/test older revisions during bisection. Let users specify it in the syz-ci config.
* pkg/vcs: apply more backports to LinuxAleksandr Nogikh2023-07-201-16/+2
| | | | | | Factor out the code that cherry-picks missing fixes to a Linux repo. Add two more commits that address issues with older kernel revisions.
* pkg/kconfig: rewrite Minimize()Aleksandr Nogikh2023-07-071-1/+7
| | | | | | | | | | | 1) Use the generic bisection implementation in pkg/bisect. It adds the support of identifying several necessary config diffs at once. 2) For now, limit the number of minimization iterations to 6. It's a lengthy process and we don't want to spend too much time doing this. 3) Bisect over leaf configuration options -- that is, those no other config depends upon. This should make diff split during bisection more reliable. 4) Save all intermediate configs to the debug files folder.
* pkg/bisect: try to drop instrumentationAleksandr Nogikh2023-07-051-14/+93
| | | | | | | | | | Refactor Minimize(). As a part of Minimize(), attempt to drop all unnecessary instrumentation and test whether the kernel is still crashing. This should reduce the number of irrelevant crashes during bisection and thus increase bisection result quality.
* pkg/vcs: move linuxAlterConfigs() to separate fileAleksandr Nogikh2023-07-051-82/+3
| | | | | The new linux_configs.go file will contain routines that manage Linux-related configs.
* pkg/vcs: search cherry-picks by titleSpace Meyer2023-06-151-2/+3
| | | | | | | | | | | | | | We sometimes cherry-pick fixes to a bisected branch, for issues that make large parts of history untestable. Previously we cherry-picked if the fix commit hash isn't already present. This is incorrect, as forks / lts trees may already cherry-picked the fix. In this case the fix would be present, but not have the expected hash. Unfortunately git doesn't have Change-Ids like gerrit, so there is no great way to check if a fix is already present. Instead we now just check whether any commit with the expected title is present.
* pkg/vcs: use gcc 10.1 for linux v5.8..v5.16Space Meyer2023-05-261-2/+4
| | | | | This was already the case before #3420. Using the default compiler so far back was overly optimistic, as pointed out in #3814.
* pkg/bisect: set linux gcc bisection cutoff to v4.18Space Meyer2023-04-201-2/+6
| | | | | | | | | | The buildroot images deployed after #2820 can only boot v4.19+ kernels. This has caused lots of bad bisection results, see #3224. We either need a new universal image or a kernel version dependant image selection. For now we stop at v4.19+. FATAL: kernel too old [ 8.076311] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
* pkg/bisect: use default compiler during bisection where possibleSpace Meyer2022-10-071-17/+25
| | | | | | | This allows us to bisect at least recently introduced bugs, where the manager that found the bug uses a non standard compiler. This is usefull during development of a new sanitizer for which a compiler with non-upstreamed patches is required.
* pkg/bisect: support clang for crash bisectionSpace Meyer2022-09-011-24/+56
| | | | | Before we hardcoded bisection to use gcc, now the compiler family can be configured in the bisection config.
* pkg/vcs: fetch linux upstream stable before bisectionsSpace Meyer2022-09-011-2/+17
|
* pkg/vcs: cherry pick fix for compiling linux with clang prior to v5.11Space Meyer2022-09-011-0/+16
|
* pkg/vcs: remove cherry-pick for making very old linux versions bootSpace Meyer2022-09-011-7/+0
| | | | | We no longer support bisecting this far back anyhow. Plus the way this checks for tags conflicts with future changes in this branch.
* 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/kconfig: store minimization resultsJouni Hogander2020-12-101-7/+8
| | | | | Store config options identified using DebugTracer. Also change bisection and configuration minimization code to use new DebugTracer.
* pkg/kconfig: accept target when parsing KconfigDmitry Vyukov2020-10-291-2/+3
| | | | | | 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-291-9/+22
| | | | | | 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.
* pkg/bisect: switch to kconfig.MinimizeDmitry Vyukov2020-10-211-154/+16
| | | | | | | | | | | | | | | 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: add repo OptPrecious and OptDontSandbox optionsDmitry Vyukov2020-10-211-4/+6
| | | | | | | | | | 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-211-4/+4
| | | | | | | Add ReleaseTag method that returns last release tag for the given commit. Update #2171
* 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: 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-311-13/+41
| | | | | | 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.
* pkg/vcs: fix config bisection tests moreDmitry Vyukov2020-07-071-0/+2
| | | | | | | | | | | 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/bisect: move checking of minimized config into common codeDmitry Vyukov2020-07-021-10/+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-021-145/+75
|
* pkg/bisect: Implement config bisectionJouni Hogander2020-07-021-0/+256
| | | | | | | | | 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.
* 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>
* 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/report: use --git-min-percent=15 for get_maintainer.plDmitry Vyukov2019-12-101-2/+4
| | | | Update #1441
* pkg/vcs: don't bisect linux past 4.6Dmitry Vyukov2019-12-101-3/+11
| | | | Fixes #1532
* pkg/build: make linux implement binary signerDmitry Vyukov2019-11-251-0/+2
| | | | | | We were almost there... Update #1271
* pkg/build: produce more deterministic linux binariesDmitry Vyukov2019-11-181-0/+2
| | | | | There are few more dynamic variables related to kernel release tagging. Set these to known deterministic values.
* pkg/vcs: make EnvForCommit return full compiler pathDmitry Vyukov2019-10-221-2/+2
| | | | | | | All callers of EnvForCommit need the compiler path, so move this logic into EnvForCommit to avoid duplication. Also simplifies tests because test impl can now return an empty compiler (which should be unused).
* pkg/bisect: add initial testing support for cause bisectionZubin Mithra2019-10-221-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | (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.
* pkg/vcs: disable CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER before v5.2Dmitry Vyukov2019-05-211-0/+4
| | | | See https://groups.google.com/d/msg/syzkaller/mODXmnauUZM/HLZiO2UDBAAJ for context.
* pkg/vcs: disable CONFIG_CAN for bisection before v4.13Dmitry Vyukov2019-03-221-0/+5
| | | | Update #501