aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/fuzzer/job.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/fuzzer,pkg/corpus: detection and preservation of programs with ↵Grigory Bazilevich13 hours1-7/+25
| | | | probability coverage
* pkg/fuzzer: use a smaller number of recommended calls for KFuzzTestEthan Graham2025-09-221-1/+1
| | | | | | | 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: remove an unnecessary cloneAleksandr Nogikh2025-04-021-1/+1
| | | | | | | | | | The Clone() we do at the beginning of the handleCall() function is unnecessary and may even confuse the people wo read and modify the code (see #5878). For all the jobs we start below, we anyway do another Clone() of the program. The corpus also does not assume that the programs in it will be modified elsewhere.
* all: remove loop variables scopingTaras Madan2025-02-171-1/+0
|
* pkg/fuzzer: add the PatchTest flagAleksandr Nogikh2024-10-251-1/+5
| | | | | When the option is set, more time is spent on "exec fuzz" and less time is spent minimizing the programs.
* pkg/fuzzer: display hints job infoAleksandr Nogikh2024-09-021-0/+15
| | | | This will let us gain even more insight into what the fuzzer is doing.
* pkg/fuzzer: improve job loggingAleksandr Nogikh2024-08-301-7/+26
| | | | | | Specify the exact call that is being minimized. Print new signal delta if it's small (these are most suspicious kinds of triage jobs).
* pkg/fuzzer: make job logging more flexibleAleksandr Nogikh2024-08-291-34/+63
| | | | Instead of printing the full program, enable per-job logs.
* syz-manager: display job lists for triage and smash jobsAleksandr Nogikh2024-08-281-3/+46
| | | | This will let us understand better what exactly the fuzzer was doing.
* prog: replace MinimizeParams with MinimizeModeDmitry Vyukov2024-08-071-30/+29
| | | | | | | | | | | | | | All callers shouldn't control lots of internal details of minimization (if we have more params, that's just more variations to test, and we don't have more, params is just a more convoluted way to say if we minimize for corpus or a crash). 2 bools also allow to express 4 options, but only 3 make sense. Also when I see MinimizeParams{} in the code, it's unclear what it means. Replace params with mode. And potentially "crash" minimization is not "light", it's just different. E.g. we can simplify int arguments for reproducers (esp in snapshot mode), but we don't need that for corpus.
* pkg/fuzzer: try to triage on different VMsDmitry Vyukov2024-08-021-4/+8
| | | | Distribute triage requests to different VMs.
* pkg/fuzzer: tune parameters for snapshot modeDmitry Vyukov2024-07-251-8/+17
| | | | | | Tune number of deflake/minimize runs in snapshot more. Presumably snapshot mode must be more stable and should require fewer runs.
* prog: restricts hints to at most 10 attempts per single kernel PCDmitry Vyukov2024-07-221-1/+3
| | | | | | | | | 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: use more permissive criteria during corpus triageDmitry Vyukov2024-07-181-35/+68
| | | | | Use 2/6 criteria during corpus triage. See the large added comment for details.
* pkg/fuzzer: speed up triage jobsAleksandr Nogikh2024-07-171-1/+9
| | | | | If we have found new signal for several calls of the same programs, triage them in paralllel.
* pkg/fuzzer: use the signal union in minimize iterationsAleksandr Nogikh2024-07-161-1/+7
| | | | | | During deflake(), we look at the unions of the signal from multiple iterations. Let's do the same in minimize(), it would be more consistent.
* pkg/fuzzer: deflake hints 3 times instead of 2Dmitry Vyukov2024-07-151-7/+7
| | | | | | Hints can produce insane amounts of candidates (up to 30K). So run deflaking one more time, even if it reduces amount of candidates by few percents, it's still profitable.
* pkg/fuzzer: optimize smash jobsDmitry Vyukov2024-07-021-22/+22
| | | | | | | | | 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-10/+13
| | | | | | | 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: separate fault injection statsAleksandr Nogikh2024-06-031-1/+1
| | | | | Let exec smash describe purely the mutation part of the smash job. Introduce a separate stat for fault injection executions.
* pkg/fuzzer: improve handling of signal for non-target callsDmitry Vyukov2024-06-031-89/+144
| | | | | | | 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-5/+5
| | | | It can be large and we need just errno. Store just it.
* pkg/fuzzer: update deflake commentDmitry Vyukov2024-06-031-3/+7
| | | | Update the comment based on our new understanding.
* pkg/fuzzer: improve triage procedureDmitry Vyukov2024-06-031-11/+18
| | | | | | | | | | | | 1. Use the initial signal as the first attempt, this should reduce total number of runs by 1 in common case. 2. Update max signal on each attempt. If should eliminate additional runs later. 3. Update the signal we are chasing after each attempt. It's possible that we won't get any of the orignal new signal, but instead will get some other stable new signal.
* pkg/fuzzer: refactor progTypesDmitry Vyukov2024-06-031-30/+5
| | | | | | | | | 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.
* prog: make minimization parameters explicitAleksandr Nogikh2024-05-271-1/+1
| | | | Add an explicit parameter to only run call removal.
* all: adapt all cover and sig to 64bitJoey Jiao2024-05-271-2/+2
| | | | | | | | | | | | | | | | | | Taken some arm64 devices for example: kaslr_offset is diff at bits 12-40, and kernel modules are loaded at 2GB space, so we have `ffffffd342e10000 T _stext` where uppper 32bit is ffffffd3. However, if we check modules range, the 1st module is loaded at 0xffffffd2eeb2a000, while the last module is loaded at 0xffffffd2f42c4000. We can see the upper 32bits are diff for core kernel and modules. If we use current 32bits for covered PC, we will get wrong module address recovered. So we need to move to 64bit cover and signal: - change cover/sig to 64bit to fit for syz-executor change - remove kernel upper base logic as kernel upper base is not a constant when kaslr enabled for core kernel and modules. - remove unused pcBase
* pkg/ipc: remove ProgInfoDmitry Vyukov2024-05-211-16/+22
| | | | | | Switch to flatrpc.ProgInfo. Note: this disables syz-runtest and syz-verifier.
* pkg/ipc: use flatrpc flagsDmitry Vyukov2024-05-171-8/+9
| | | | | | 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: simplify prog execution optionsAleksandr Nogikh2024-05-161-5/+6
| | | | For now, only ProgTypes is enough.
* pkg/fuzzer: manipulate ipc.ExecOptsAleksandr Nogikh2024-05-161-24/+24
| | | | There's no need in duplicating the signal, coverage, hints flags.
* pkg/fuzzer/queue: retry inputs from crashed VMsAleksandr Nogikh2024-05-161-0/+2
| | | | | | | | | | Mark some requests as Important. The Retry() layer will give them one more chance even if they were not executed due to a VM crash. For now, the only important requests are related to triage, candidates and pkg/vminfo tests. Add tests for retry.go.
* pkg/fuzzer: introduce a request restarter layerAleksandr Nogikh2024-05-161-7/+8
| | | | | | Make Result statuses more elaborate. Instead of retrying inputs directly in rpc.go, extract this logic to a separate entity in pkg/fuzzer/queue.
* pkg/fuzzer: use queue layersAleksandr Nogikh2024-05-161-90/+45
| | | | | | | | | | | 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: deflake comparisonsAleksandr Nogikh2024-05-151-9/+22
| | | | | | Do two exec hints to only leave stable comparison argument pairs. In local experiments, it allows to reduce their count by 30-40% (on average).
* pkg/fuzzer: minor cleanupDmitry Vyukov2024-04-301-6/+5
| | | | | Remove unused fields. Check that we don't need to triage program earlier.
* pkg/fuzzer: move Signal type from rpctypeDmitry Vyukov2024-04-301-8/+7
| | | | | | 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-4/+5
| | | | | | | | | | | 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: fix fault injectionAleksandr Nogikh2024-04-121-1/+1
| | | | We used to send the non-modified program for execution.
* pkg/fuzzer: deflake against new signalAleksandr Nogikh2024-04-091-3/+4
| | | | | | We don't want to reach just any stable signal, we know the specific new signal that we target. The previous approach might have reduced the efficiency of the new deflake() approach.
* all: refactor statsDmitry Vyukov2024-04-091-22/+21
| | | | | | | 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: make deflake() more flexibleAleksandr Nogikh2024-04-051-23/+32
| | | | | Demand that at least 3 out of 5 runs share common signal. Exit early if it's not feasible.
* pkg/fuzzer: don't triage saturated callsDmitry Vyukov2024-04-031-10/+6
| | | | | | | 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: mix in exec fuzz and exec genAleksandr Nogikh2024-03-251-12/+25
| | | | | | | | | | | | | 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.
* all: move fuzzer to the hostAleksandr Nogikh2024-03-251-15/+14
| | | | | | | | | | | | 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: ignore new max signal during triageAleksandr Nogikh2024-03-191-10/+11
| | | | | | 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/corpus: a separate package for the corpus functionalityAleksandr Nogikh2024-03-181-19/+15
| | | | | | | | 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.
* prog: enable MutateWithHints() abortionAleksandr Nogikh2024-03-141-6/+2
| | | | | The call may potentially generate a very large number of possible mutations. Add a way to abort the process.
* pkg/fuzzer: factor out the fuzzing engineAleksandr Nogikh2024-03-121-0/+401
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.