aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/fuzzer/fuzzer.go
Commit message (Collapse)AuthorAgeFilesLines
* syz-manager: information about probability-only inputs in dbGrigory Bazilevich16 hours1-2/+3
|
* pkg/fuzzer,pkg/corpus: detection and preservation of programs with ↵Grigory Bazilevich17 hours1-5/+7
| | | | probability coverage
* all: use any instead of interface{}Dmitry Vyukov2025-12-221-2/+2
| | | | Any is the preferred over interface{} now in Go.
* pkg/fuzzer: use a smaller number of recommended calls for KFuzzTestEthan Graham2025-09-221-0/+8
| | | | | | | Introduce a KFuzzTest mode for the fuzzer so that a smaller number of recommended calls can be used if we are fuzzing KFuzzTest targets. Signed-off-by: Ethan Graham <ethangraham@google.com>
* pkg/fuzzer: add stats for overflowed coverage/compsAlexander Potapenko2025-08-051-0/+2
|
* pkg/manager: wait until corpus is triaged for diff fuzzingAleksandr Nogikh2025-04-151-1/+5
| | | | | | | | | | | Track the right moment to start bug reproductions more exactly: 1) Either once 90% of the corpus is triaged (*). 2) Or once we are past 50% of the time dedicated for fuzzing. Whatever happens earlier. (*) The last percents are usually quite slow and they bring much less covered PCs that all the previous ones.
* pkg/manager: show number of times coverage for each call has overflowedDmitry Vyukov2024-11-201-1/+21
| | | | | If the overflows happen often, it's bad. Add visibility into this.
* pkg/fuzzer: add the PatchTest flagAleksandr Nogikh2024-10-251-2/+10
| | | | | When the option is set, more time is spent on "exec fuzz" and less time is spent minimizing the programs.
* syz-manager: move DefaultExecOpts() to pkg/Aleksandr Nogikh2024-10-251-0/+32
| | | | This will enable its reuse.
* executor: better handling for hanged test processesDmitry Vyukov2024-10-241-4/+5
| | | | | | | | | | | | | | | Currently we kill hanged processes and consider the corresponding test finished. We don't kill/wait for the actual test subprocess (we don't know its pid to kill, and waiting will presumably hang). This has 2 problems: 1. If the hanged process causes "task hung" report, we can't reproduce it, since the test finished too long ago (manager thinks its finished and discards the request). 2. The test process still consumed per-pid resources. Explicitly detect and handle such cases: Manager keeps these hanged tests forever, and we assign a new proc id for future processes (don't reuse the hanged one).
* pkg/fuzzer: make job logging more flexibleAleksandr Nogikh2024-08-291-5/+15
| | | | Instead of printing the full program, enable per-job logs.
* syz-manager: display job lists for triage and smash jobsAleksandr Nogikh2024-08-281-5/+32
| | | | This will let us understand better what exactly the fuzzer was doing.
* pkg/fuzzer: don't retry triage in snapshot modeDmitry Vyukov2024-08-131-0/+5
|
* pkg/fuzzer: try to triage on different VMsDmitry Vyukov2024-08-021-4/+5
| | | | Distribute triage requests to different VMs.
* pkg/fuzzer: tune parameters for snapshot modeDmitry Vyukov2024-07-251-0/+1
| | | | | | Tune number of deflake/minimize runs in snapshot more. Presumably snapshot mode must be more stable and should require fewer runs.
* pkg/stat: rename package name to singular formDmitry Vyukov2024-07-241-2/+2
| | | | | | | | Go package names should generally be singular form: https://go.dev/blog/package-names https://rakyll.org/style-packages https://groups.google.com/g/golang-nuts/c/buBwLar1gNw
* prog: restricts hints to at most 10 attempts per single kernel PCDmitry Vyukov2024-07-221-4/+5
| | | | | | | | | We are getting too many generated candidates, the fuzzer may not keep up with them at all (hints jobs keep growing infinitely). If a hint indeed came from the input w/o transformation, then we should guess it on the first attempt (or at least after few attempts). If it did not come from the input, or came with a non-trivial transformation, then any number of attempts won't help. So limit the total number of attempts (until the next restart).
* pkg/fuzzer: remove signal rotationDmitry Vyukov2024-07-021-12/+0
| | | | | | | Signal rotation is intended to make the fuzzer re-discover flaky coverage in non flaky way. However, taking into accout that we get effectively the same effect after each manager restart, and that the fuzzer is overloaded with triage/smash jobs, it does not look to be worth it.
* pkg/fuzzer: optimize smash jobsDmitry Vyukov2024-07-021-3/+9
| | | | | | | | | 1. Run only 25 mutations during smash. 2. Run collide during normal fuzzing rather than during smashing. 3. Run hints and fault injection before random mutations and order hints/fault injection jobs. 4. Random mutations still run round-robin w/o ordering to give better diversity.
* executor: add runner modeDmitry Vyukov2024-06-241-2/+0
| | | | | | | Move all syz-fuzzer logic into syz-executor and remove syz-fuzzer. Also restore syz-runtest functionality in the manager. Update #4917 (sets most signal handlers to SIG_IGN)
* pkg/fuzzer: improve handling of signal for non-target callsDmitry Vyukov2024-06-031-23/+27
| | | | | | | During deflake/minimization we have 1 target call that should be handled specially: during triage we want all signal, during minimization we want new+target signal. For the rest of the calls we can do normal handling: collect new signal and start triage if we see any new signal.
* pkg/fuzzer: don't keep whole call info for triage jobsDmitry Vyukov2024-06-031-1/+1
| | | | It can be large and we need just errno. Store just it.
* pkg/fuzzer: smarter retry for corpus candidatesDmitry Vyukov2024-06-031-19/+36
| | | | | | | | Currently we always retry corpus candidates 2 times. Retry up to 3 times if we did not get new signal. This should both reduce total number of runs (if we get new signal on the first run) and reduce signal loss after restart (since we try up to 3 times instead of 2).
* pkg/fuzzer: refactor progTypesDmitry Vyukov2024-06-031-10/+24
| | | | | | | | | The next commit will add another Candidate flag. Candidate flags duplicate progTypes enum, so to avoid conversions of one to another use progTypes in Candidate struct directly. Rename progTypes to progFlags since multiple can be set, so this is effectively flags rather than a single type.
* syz-manager: add corpus triage modeDmitry Vyukov2024-06-031-4/+12
| | | | | | | | Add corpus triage mode and support it in testbed. This is useful to benchmark just the triage phase w/o any subsequent fuzzing. First, fuzzing is more random. Second, if triage duration is different in different versions, then they will do different amount of fuzzing in fixed testbed time.
* pkg/ipc: remove ExecOptsDmitry Vyukov2024-05-211-4/+3
| | | | Switch to flatrpc.ExecOpts.
* pkg/ipc: remove ProgInfoDmitry Vyukov2024-05-211-7/+10
| | | | | | Switch to flatrpc.ProgInfo. Note: this disables syz-runtest and syz-verifier.
* pkg/ipc: use flatrpc flagsDmitry Vyukov2024-05-171-2/+3
| | | | | | Flatrpc flags are passed in RPC execution requests, so to avoid conversions and duplicate set of flags use flatrpc flags in pkg/ipc directly.
* pkg/fuzzer/queue: simplify the priority queueAleksandr Nogikh2024-05-161-5/+5
| | | | | | We don't need the full priority queue functionality anymore. For our purposes it's enough to only enforce the order between the elements of different sub-queues.
* pkg/fuzzer: simplify prog execution optionsAleksandr Nogikh2024-05-161-23/+14
| | | | For now, only ProgTypes is enough.
* pkg/fuzzer: manipulate ipc.ExecOptsAleksandr Nogikh2024-05-161-13/+15
| | | | There's no need in duplicating the signal, coverage, hints flags.
* pkg/fuzzer: use queue layersAleksandr Nogikh2024-05-161-125/+118
| | | | | | | | | | | Instead of relying on a fuzzer-internal priority queue, utilize stackable layers of request-generating steps. Move the functionality to a separate pkg/fuzzer/queue package. The pkg/fuzzer/queue package can be reused to add extra processing layers on top of the fuzzing and to combine machine checking and fuzzing execution pipelines.
* pkg/fuzzer: minor cleanupDmitry Vyukov2024-04-301-17/+10
| | | | | Remove unused fields. Check that we don't need to triage program earlier.
* pkg/fuzzer: move Signal type from rpctypeDmitry Vyukov2024-04-301-5/+12
| | | | | | Now that manager sends ipc.ExecOpts to the fuzzer, there is no point in having Signal type in rpctype. It belongs to pkg/fuzzer.
* pkg/fuzzer: fix signal filtering during minimizationDmitry Vyukov2024-04-151-1/+7
| | | | | | | | | | | This fixes 2 issues: 1. We still want to get new coverage for syscalls during minimization. We run lots of new programs, and some of them can give new coverage. 2. The signal filter should apply only to the target syscall. Other syscalls probably can't even reach any of that code. So add SignalFilterCall field and combine new and filtered signal for that call. Other calls just collect new coverage as usual.
* pkg/fuzzer: remove stats leftoverDmitry Vyukov2024-04-101-2/+0
|
* all: refactor statsDmitry Vyukov2024-04-091-23/+20
| | | | | | | Add ability for each package to create and export own stats. Each stat is self-contained, describes how it should be presented, and there is not need to copy them from one package to another. Stats also keep historical data and allow building graphs over time.
* pkg/fuzzer: don't triage saturated callsDmitry Vyukov2024-04-031-1/+9
| | | | | | | Currently we throw away saturated calls only after triage/minimization. Triage/minimization is unnecessary for saturated calls, we already know we will throw them away later. Don't send saturated calls for triage/minimization.
* pkg/fuzzer: remove Request.result fieldDmitry Vyukov2024-04-021-2/+0
|
* pkg/fuzzer: mix in exec fuzz and exec genAleksandr Nogikh2024-03-251-17/+19
| | | | | | | | | | | | | The fuzzer may become too busy doing potentially very long hint jobs, while we want it to also keep exploring other parts of the input space. If there are only smash and hint jobs left, ignore them for 33% of executions. Reduce the number of smash iterations: 1) If new coverage is found, we will likely repeat the smash job with a similar program. 2) We mostly do the same during exec fuzz anyway.
* pkg/fuzzer: implement basic max signal rotationAleksandr Nogikh2024-03-251-0/+12
| | | | | | | Once in 15 minutes, drop 1000 elements of the pure max signal (that is, max signal minus corpus signal). It seems to have a positive effect on the total fuzzing performance.
* all: move fuzzer to the hostAleksandr Nogikh2024-03-251-50/+27
| | | | | | | | | | | | Instead of doing fuzzing in parallel in running VM, make all decisions in the host syz-manager process. Instantiate and keep a fuzzer.Fuzzer object in syz-manager and update the RPC between syz-manager and syz-fuzzer to exchange exact programs to execute and their resulting signal and coverage. To optimize the networking traffic, exchange mostly only the difference between the known max signal and the detected signal.
* pkg/fuzzer: remove leak checking optionAleksandr Nogikh2024-03-251-1/+0
| | | | It does not affect fuzzing.
* pkg/fuzzer: disable leaked Request checkingAleksandr Nogikh2024-03-251-34/+5
| | | | We'll be tracking requests in syz-manager.
* pkg/fuzzer: ignore new max signal during triageAleksandr Nogikh2024-03-191-0/+6
| | | | | | We are already trying to filter out any flaky coverage at that stage. Any new signal that we got by re-running the same program can be automatically treated as flaky as well.
* pkg/fuzzer: expose the number of candidates and running jobsAleksandr Nogikh2024-03-191-3/+12
|
* all: rename corpus and fuzzer Stat objectsAleksandr Nogikh2024-03-191-7/+7
| | | | | Stats() seems to be a more sound choice since these structures include multiple data points.
* pkg/corpus: a separate package for the corpus functionalityAleksandr Nogikh2024-03-181-7/+20
| | | | | | | | pkg/fuzzer and syz-manager have a common corpus functionality that can be well be unified. Create a separate pkg/corpus package that would be used by both of them. It will simplify further work of moving pkg/fuzzer to the host.
* pkg/fuzzer: factor out the fuzzing engineAleksandr Nogikh2024-03-121-0/+350
This is the first step for #1541. Move the fuzzing engine that used to be interleaved with other syz-fuzzer code into a separate package. For now, the algorithm is more or less the same as it was, the only difference is that a pkg/fuzzer instance scales to the available computing power. Add an executor-based test that performs real fuzzing.