aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-repro
Commit message (Collapse)AuthorAgeFilesLines
* pkg/repro: accept a cancellable contextAleksandr Nogikh2024-11-131-1/+6
| | | | | | | | | | Refactor pkg/repro to accept a context.Context object. This will make it look more similar to other package interfaces and will eventually let us abort currently running repro jobs without having to shut down the whole application. Simplify the code by factoring out the parameters common both to RunSyzRepro() and RunCRepro().
* tools/syz-repro: order Loop() and vmPool.Close()Aleksandr Nogikh2024-10-111-35/+37
| | | | | | | | | There used to be no strict ordering between cancelling the loop context and the actual moment the Loop() method exits. Now that we assert that all instances are freed in vmPool.Close(), we need to wait until Loop() finishes before closing the VM pool. Restructure the main() method to ensure this order.
* vm: make sure vm.Pools are cleaned upCameron Finucane2024-09-191-0/+1
| | | | Add calls to Close() from all locations that call Create().
* tools/syz-repro: fix the toolAleksandr Nogikh2024-07-151-0/+5
| | | | We need to call Pool.Loop() to make it boot instances.
* all: transition to instance.PoolAleksandr Nogikh2024-07-111-13/+8
| | | | | Rely on instance.Pool to perform fuzzing and do bug reproductions. Extract the reproduction queue logic to separate testable class.
* pkg/repro, pkg/ipc: use flatrpc.FeatureDmitry Vyukov2024-05-061-1/+2
| | | | | | | Start switching from host.Features to flatrpc.Features. This change is supposed to be a no-op, just to reduce future diffs that will change how we obtain features.
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-2/+1
|
* tools/syz-repro: save the resulting bug title to a separate fileAleksandr Nogikh2022-11-251-29/+49
| | | | | | | This will facilitate reproduction efficiency testing. Factor out parts of the main function, as otherwise we get linter errors.
* all: run strace on each found reproducerAleksandr Nogikh2022-04-291-0/+18
| | | | | | | | If `strace_bin` is specified, syzkaller will invoke a reproducer with it and save the output. This should help in debugging. If syz-manager is attached to a dashboard, upload the strace-powered output and report.
* tools/syz-repro/repro.go: save syz-repro output to filesKenneth Kang2022-01-071-1/+18
| | | | saves syz-repro output and C file. Fixes #2951.
* pkg/mgrconfig: add prog&sys.targets targets to ConfigDmitry Vyukov2020-11-301-4/+0
| | | | | | These are widely used with the config as the refactoring shows. This removes a bunch of unnecessary code. Also fixes a number of bugs where we confused Arch with VMArch.
* all: fix format of fmt.Printf/Fprintf callsDmitry Vyukov2020-11-301-5/+5
|
* pkg/repro: don't enable features missing on the targetDmitry Vyukov2020-06-031-1/+1
| | | | | | | Manager has already checked what features are present on the target. But if we detected that, say, USB is missing, we still enabled it in the starting csource options. This is wrong, increases configuration minimization time and may lead to some obscure bugs.
* pkg/log: rename -v to -vvDmitry Vyukov2019-07-161-1/+1
| | | | | To avoid conflicts with programs that import both syzkaller packages and github.com/golang/glog which also defines -v flag.
* ReviewGreg Steuck2018-11-211-1/+1
|
* syz-repro: minor UX improvements.Greg Steuck2018-11-211-7/+8
|
* pkg/mgrconfig: move from syz-manager/mgrconfigDmitry Vyukov2018-08-021-1/+1
| | | | | | | | mgrconfig was used only by syz-manager initially, but now it's used by a dozen of packages and it's weird to import from under a binary dir. pkg/ is much more reasonable dir for a widely used helper package.
* pkg/repro: provide stats even for failed reproDmitry Vyukov2018-07-051-1/+8
| | | | | | | Provide stats and logs for failed repro and save it in manager. In particular log is useful for failed repros, currently there is no visibility into why bugs failed to reproduce.
* tools/syz-repro: add debug modeDmitry Vyukov2018-07-051-1/+2
|
* pkg/report: allow to specify suppressions per OSDmitry Vyukov2018-06-221-3/+2
| | | | | | | | | | | | | Currently all (linux-specific) suppressions are hardcoded in mgrconfig. This is very wrong. Move them to pkg/report and allow to specify per OS. Add gvisor-specific suppressions. This required a bit of refactoring. Introduce mgrconfig.KernelObj finally. Make report.NewReporter and vm.Create accept mgrconfig directly instead of passing it as multiple scattered args. Remove tools/syz-parse and it always did the same as tools/syz-symbolize. Simplify global vars in syz-manager/cover.go. Create reporter eagerly in manager. Use sort.Slice more. Overall -90 lines removed.
* pkg/report: pass vm type to NewReporterDmitry Vyukov2018-06-221-1/+1
| | | | | For the case when VM type affects output. Will be needed for gvisor. It is kinda linux, but kinda not.
* all: get rid of underscores in identifiersDmitry Vyukov2018-05-071-1/+1
| | | | | | Underscores are against Go coding style. Update #538
* pkg/report: support multiple OSesDmitry Vyukov2017-10-181-21/+16
| | | | | | Introduce report.Reporter interface. Add an implementation per-OS. Make users be explicit about OS they are testing.
* prog: remove default target and all global stateDmitry Vyukov2017-09-151-1/+1
| | | | | | Now each prog function accepts the desired target explicitly. No global, implicit state involved. This is much cleaner and allows cross-OS/arch testing, etc.
* syz-manager/mgrconfig: explicitly specify target in configDmitry Vyukov2017-09-151-1/+5
| | | | | Add target config parameter (e.g. linux/amd64) which controls target OS/arch. No more explicit assumptions about target.
* syz-manager/mgrconfig: move sshkey from vm config to manager configDmitry Vyukov2017-06-171-7/+1
| | | | | | | | | | | | | | Sshkey is a property of image, which is in manager config. Move sshkey to the same location as image. The motivation for the move is as follows. Continuous build produces an image and the key, both need to be passed manager instance. Continuous build system should not distinguish different VM types and mess with their configs. NOTE FOR USERS: this breaks manager configs again. Hopefully the last time for now. Docs are updated.
* pkg/csource: move from csourceDmitry Vyukov2017-06-171-1/+1
|
* pkg/repro: move from pkgDmitry Vyukov2017-06-171-1/+1
|
* syz-manager/mgrconfig: allow loading from memoryDmitry Vyukov2017-06-171-1/+1
| | | | | | Allow loading manager config from memory. Follow pkg/config naming convention, i.e. LoadFile/LoadData instead of Parse.
* syz-manager/config: rename to syz-manager/mgrconfigDmitry Vyukov2017-06-171-2/+2
| | | | | | | | | | | We have 2 packages with the same name: pkg/config and syz-manager/config. This leads to constant clashes. We either rename one to pkgconfig or another to mgrconfig. This is not good and will become worse when/if we have another program-specific config in a separate package. Rename manager config to mgrconfig. Other program-specific configs can use the same convention in future -- fooconfig.
* tools: repro: fix vm count calculationAndrey Konovalov2017-06-121-1/+1
|
* tools: repro: fix vm count calculationAndrey Konovalov2017-06-071-1/+1
|
* vm: overhaulDmitry Vyukov2017-06-031-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VM infrastructure currently has several problems: - Config struct is complete mess with a superset of params for all VM types - verification of Config is mess spread across several places - there is no place where VM code could do global initialization like creating GCE connection, uploading GCE image to GCS, matching adb devices with consoles, etc - it hard to add private VM implementations such impl would need to add code to config package which would lead to constant merge conflicts - interface for VM implementation is mixed with interface for VM users this does not allow to provide best interface for both of them - there is no way to add common code for all VM implementations This change solves these problems by: - splitting VM interface for users (vm package) and VM interface for VM implementations (vmimpl pacakge), this in turn allows to add common code - adding Pool concept that allows to do global initialization and config checking at the right time - decoupling manager config from VM-specific config each VM type now defines own config Note: manager configs need to be changed after this change: VM-specific parts are moved to own "vm" subobject. Note: this change also drops "local" VM type. Its story was long unclear and there is now syz-stress which solves the same problem.
* pkg/log: move from logDmitry Vyukov2017-06-031-1/+1
|
* config: split and refactorDmitry Vyukov2017-06-011-1/+1
| | | | | | | | | Introduce generic config.Load function that can be reused across multiple programs (syz-manager, syz-gce, etc). Move the generic config functionality to pkg/config package. The idea is to move all helper (non-main) packages to pkg/ dir, because we have more and more of them and they pollute the top dir. Move the syz-manager config parts into syz-manager/config package.
* vm: add Odroid supportAndrey Konovalov2017-03-101-0/+1
| | | | | | | | | | | This commit adds Odroid C2 support to syzkaller. It's now possible to specify "type": "odroid" in manager config. Documentation on how to setup fuzzing with Odroid C2 board is here: https://github.com/google/syzkaller/wiki/Setup:-Odroid-C2 Note, that after this change libusb-1.0-0-dev package should be installed to build syzkaller.
* manager: add ability to ignore bugsDmitry Vyukov2016-12-191-1/+1
| | | | | | Add new config parameter "ignores" which contains list of regexp expressions. If one of the expressions is matched against oops line, crash report is not saved and VM is not restarted.
* repro: factor out of syz-repro toolDmitry Vyukov2016-11-191-219/+22
| | | | | | | | Factor out repro logic from syz-repro tool, so that it can be used in syz-manager. Also, support sandboxes in code generated by csoure. This is required to reproduce crashes that require e.g. namespace sandbox.
* log: add packageDmitry Vyukov2016-10-091-29/+29
| | | | | | | | | | | Log is a simple wrapper around std log package. It is meant to solve 2 main problems: 1. Logging from non-main packages (mainly, vm/* packages). Currently they can either always log or not log at all. But they can't respect program verbosity setting. Log package allows all packages to use the same verbosity setting. 2. Exposing recent logs in html UI. Namely we want to tee logs to console and html UI.
* vm/gce: add support GCE VMsDmitry Vyukov2016-10-061-0/+1
|
* manager, repro: unify VM monitoringDmitry Vyukov2016-09-011-36/+8
| | | | | | Unify and factor out VM monitoring loop used in syz-manager and syz-repro. This allows syz-repro to detect all the same bugs (e.g. "no output", "lost connection", etc). And also just deduplicates code.
* report: extract better, unique identifiers of oopsesDmitry Vyukov2016-08-311-3/+17
|
* report: add a new package for report parsing and processingDmitry Vyukov2016-08-301-2/+3
| | | | Move vm.FindCrash to the new package.
* vm/adb: support multiple adb devicesDmitry Vyukov2016-08-301-7/+8
| | | | Device IDs are specified in "devices" config param.
* repro: a little bit more graceful shutdownDmitry Vyukov2016-08-281-3/+32
| | | | | Bring down at least some VM instances. Booting instances can still leak.
* repro: use correct sandbox modeDmitry Vyukov2016-08-281-2/+2
| | | | Update #59
* csource: support nonfailing argument copyin/copyoutDmitry Vyukov2016-08-281-0/+1
| | | | Update #59
* config: check presence of syz-execprog only in syz-reproDmitry Vyukov2016-02-161-0/+3
| | | | syz-execprog is not built by 'make', so syz-manager fails for first-timers.
* vm: faster output oops greppingDmitry Vyukov2016-01-191-8/+8
| | | | | | Use manual parsing instead of a regexp. Regexp takes ~220ms for typical output size. New code takes ~2ms. Brings manager CPU consumption from ~250% down to ~25%.
* vm/adb: add adb-based VMDmitry Vyukov2016-01-111-0/+1
| | | | vm/adb can be used to fuzz on real android devices.