Commit Graph

36 Commits

Author SHA1 Message Date
Henrik Brodin 00a7a4be33 Merge SubmissionEntries based on similarity and on patch mitigation (#899)
* Use an internal_patch_id instead of indices

This is the first step in being able to merge sets of PoVs and test
patches against all PoVs within a task.

* Discard redundant builds

* Initial PoV-merging strategy

Still not optimal in terms of SARIF-matching/bundling etc

* Appears to be working version of merging including bundle and sarif handling

* Make tests pass

* Update integration test steps

* Fixes and cleanup from review

* Removed additional request for patched builds

* Refactored some loops into find-style functions to simplify

* Inline small function used once

* Refactors for increased robustness and readability including additional testing

* SARIF matching - additional tests and refactor

* Add enumerate_task_submissions

* Refactor and simplify tests using a builder

Cleanup unused code

* Fix read_submissions to use CrashWithId

* Improvements based on review

* Cache final states of PoV reproduce (#909)

As these never change we can limit the load on redis by caching the
results.

* Merge SubmissionEntries based on patches (#910)

* Cache final states of PoV reproduce

As these never change we can limit the load on redis by caching the
results.

* Merge SubmissionEntries based on patches

If a PoV in another entry is mitigated by the current entry's patch,
merge the entries as athey should be considered the same
ChallengeVulnerability.

* Add positional argument

* Hold of submitting a patch while evaluating

Check each already submitted patch before submitting a new one for the
same task. If any of the already submitted patches mitigates any PoV in
the current SubmissionEntry - do not submit this. It will be merged
later on.

* Additional logging, truncate ids

* Only request patch if no submitted patch mitigates

Before we request a new patch, we check each of the already submitted
patches to see if any of them already mitigates the PoVs in the current
SubmissionEntry. If they do, this will be merged at a later stage.

* PR feedback
2025-06-22 12:36:37 +02:00
Henrik Brodin 6409b5be0c Use an internal_patch_id instead of indices (#867)
* Use an internal_patch_id instead of indices

This is the first step in being able to merge sets of PoVs and test
patches against all PoVs within a task.

* Discard redundant builds

* Compare relevant fields
2025-06-18 14:08:50 +02:00
Henrik Brodin 41eda082fa Initial orchestrator deduplication (#838)
* Initial orchestrator deduplication

This is the first phase handling of PoV duplicates. PoVs having
identical crashes are stopped at the fuzzer. Others migrate to the
orchestrator. In the orchestrator PoVs are compared to see if they are
'similar' to any other PoV. If so they are bundled and each are used to
validate patch quality before submitting.

This PR basically acts as a filter for only submitting a patch for any
PoV considered similar before the patch can be submitted the first time.

* Make sure duplicates are only considered for the same task

---------

Co-authored-by: Michael D Brown <michael.brown@trailofbits.com>
2025-06-12 23:15:46 +02:00
Riccardo Schirone db6f4ac44b Initial pov-reproducer (#822) 2025-06-12 15:01:24 +02:00
Riccardo Schirone aad0a97937 patcher: switch to multiple PoVs in a ConfirmedVulnerability (#826) 2025-06-11 15:38:33 +02:00
Riccardo Schirone d877b0cdd7 orchestrator: patched build requests (#820) 2025-06-11 15:12:28 +02:00
Riccardo Schirone b81135bf66 Make builder-bot build patched versions (#819)
* Make builder-bot build patched versions

* orchestrator: test new build outputs

* address review

* builder-bot: use times_delivered logic in case of failures
2025-06-10 09:58:38 -04:00
Henrik Brodin e55ebf31e4 Cleanup of submission logic (#467)
* Cleanup of submission logic

Retries patches, and moves on to next patch if available
Handles the errored state
Prepares for SARIF submission (missing the SARIF matching)
Patches bundles to include SARIF

* remove whitespace

* Limit impact of exceptions

If an exception is raised while processing a vulnerability, we
would previuosly stop processing any vulnerabilities. This change
enables processing to continue for other vulnerabilities.
2025-04-29 10:40:32 +02:00
Riccardo Schirone 6dfdddd445 common|fuzzer: store crash token in protobuf (#445)
Co-authored-by: Michael D Brown <michael.brown.uc@gmail.com>
2025-04-24 12:07:08 -04:00
Boyan MILANOV 966c184129 Make build_type a proper enum (#346)
* Make build type an int enum

* Lint

* Fix protobuf

* Fix protobuf for linux

* Remove old  enum and use the  class from protobuf message

* Lint

* Fix tests

* Print build type name instead of int value in logs

* Try fix enum instanciation in scheduler

* Correctly get protobuf enum name for BuildType values using EnumTypeWrapper methods

* Fix import

---------

Co-authored-by: Boyan MILANOV <boyanmilanov@coder-boyanmilanov-aixcc-boyan.c.production-1-405717.internal>
2025-04-07 11:54:42 +03:00
Henrik Brodin c2e2dc95c7 Include task metadata (#290) 2025-03-28 09:27:10 +01:00
Ronald Eytchison 300e9d438a Use code coverage in seed-gen to sample functions (#204)
* Calculate function coverage fraction

Note: function isn't tested yet

* Store function coverage in Redis

* Sample function off coverage map in seed-gen

* Conditionally update function coverage

* Try multiple definition lookup heuristics

* Log function probability and coverage fraction

* Fix calculate_function_probabilities

* Fix docstring
2025-03-24 21:16:59 -04:00
Henrik Brodin 42ed9402f0 Stop work on expired (#196)
* Implements task cancelation

- Cancel one or all tasks.
- delete_task.sh script for invoking
- refactored to keep deleted tasks in a separate set, update tasks as
  needed from registry instead of updating the stored tasks.

* Refactor cancellation, update use in vulnerabilities

* Cleanup cancellation

* Remove package_name from protomsg

* Fix test case

* fix tests

* PR feedback
2025-03-19 18:00:16 +01:00
Riccardo Schirone 7fb382035d Update protobuf auto-generated code to remove package_name field (#198)
* Update protobuf auto-generated code to remove package_name field

* ci: ensure protobuf is always updated

* fix test_vulnerabilities

* lint

* fix pathcer test

* fix other tests

* lint

* fix ci

* REMOVE ME: test ci

* removed
2025-03-12 13:01:13 +01:00
Henrik Brodin fe07435b77 Create the TaskMeta structure in the task directory (#79)
* Create the TaskMeta structure in the task directory

it contains information about project name and focus.

* lint

* Address review

* Restore name property
2025-02-20 03:48:23 +01:00
Evan Downing c6892939dc Updates program model directory (#66)
* Modify protobuf

* Update directory parameters for program model

* Update directory calls and build image call

* Always apply diff

* Always apply diff
2025-02-19 15:59:40 -05:00
2over12 916f49048a Tracer (#38)
* task updates

* tracer

* tracer queue

* update pb

* finish up fuzzer bot

* regen proto

* task updates

* fix again

* newline

* add tracer bot compose

* add compose

* update orchestrator

* fix some tests

* fix group names

* ack the item

* fix import

* fix

* stub patcher interaction

* fix queue for now

* fix patcher

* formatting

* fixes

* parse stack trace

* bump stack trace

* merge proto

* update patcher:

* shorten timeout

* fix seedgen

* fix lint

* fix lints

* get rid of todo
2025-02-19 10:08:12 -05:00
Henrik Brodin 34fb10c4e2 Henrik/no build request mock (#64)
* Implement actual build request creation

Removes the mock and adds functionality to parse the project yaml.

* Move the ProjectYaml to common

* lint

* Pass in the correct name

* pr feedback

* Tmpfix uvlock
2025-02-19 00:22:27 +01:00
2over12 ea2fd093d5 Program model integrate (#13)
* Add documentation

* Add janusgraph custom configuration. Simply graph creation.

* Add properties to edges. Index on uri property.

* reformat

* Create libpng graph in a more reasonable amount of time.

* Update README.md

* Wrap indexing into function

* updating...

* update proto

* fix command

* Update settings for serve and processing indexing

* Add dockerfile to docker container

* Add trigger script

* Fix error with loading graphml file

* reformat

* Remove resource constraints for program model

* Change permissions of temp dir

* Update readme

* Update dockerignore

---------

Co-authored-by: Evan Downing <2077950+evandowning@users.noreply.github.com>
2025-02-18 11:59:16 -05:00
2over12 3668cd9301 Apply diff in builder bot (#32)
* apply diff in builder bot

* fix dockerfile seed-gen

* format

* apply the diffs

* fix builds

* store if diff was applied

* Revert "format"

This reverts commit f07a806ebd98f16409f0c3676aefc50441562239.
2025-02-18 10:43:51 -05:00
Ian Smith 49b727fa8f move to tasks 2025-02-10 17:54:12 +00:00
Riccardo Schirone a57f10c75e orchestrator/downloader: make task storage structure more rigid (#64)
New task structure:
```
/tasks_storage/<task-id>
/tasks_storage/<task-id>/src/
/tasks_storage/<task-id>/src/<dynamic-name-depending-on-src-tar-file>/...
/tasks_storage/<task-id>/fuzz-tooling/
/tasks_storage/<task-id>/fuzz-tooling/<dynamic-name-depending-on-fuzz-tar-file>/....
/tasks_storage/<task-id>/diff/
/tasks_storage/<task-id>/diff/<dynamic-name-depending-on-diff-tar-file>/....
```
2025-02-04 11:12:15 +01:00
2over12 b831ec0e2b Allow multiple build types per harness (#63)
* switch maps around

* change corpuses to merge up

* fix build bot

* fixes

* change proto name

* fix

* dedup with other task maps

* fix tester

* update invocation

* fix value

* format

* fix typo

* typos

* fix tests

* try update tests

* skip

* update protoc

* format

* add fuzzer build type

* fix typo

* format
2025-02-03 08:34:55 -05:00
2over12 288c9dc6b9 First cut fuzzer side crash dedup (#60)
* add stacktrace for consumers

* add set

* crash dedup

* update dedup to include info that prevents clash accross diff task

* update key

* fix flag

* format

* actually point to set object

* fix to be correct
2025-02-03 08:18:11 -05:00
Riccardo Schirone b3d53cc1f2 patcher: base skeleton (#43)
* patcher: skeleton component
* add patcher to compose
* fix indexer-run and scheduler
2025-01-31 13:45:40 +01:00
Henrik Brodin fa47c864b9 Add task_id field to BuildRequest and BuildOutput messages and update all related code paths 2025-01-31 08:31:02 +00:00
Henrik Brodin b5c17df6e5 wip 2025-01-30 11:12:40 +00:00
Henrik Brodin 98d05ee192 Missed some imports and clarified protobufs 2025-01-30 10:24:09 +00:00
Henrik Brodin c7fa042225 Merge protobufs
The two protobufs fuzzer_msg.proto and orchestrator.proto has been
replaced with a single msg.proto. This is to make it easier to embedd
structures in other structures across protos. Just compoling the protos
work well, but python imports break. As there aren't that many
structures merging seamed like an easy fix.
2025-01-30 10:09:41 +00:00
Henrik Brodin 7359bd4773 Merge remote-tracking branch 'origin/main' into henrik/merge-del-orchestrator 2025-01-29 07:51:44 +00:00
2over12 53189ccec4 Fuzzer output Queue (#40)
* update proto with Crash def

* add crash q

* format

* output q

* format

* changes for builder.
2025-01-28 09:17:24 -05:00
Henrik Brodin 7d6a6190ef Delete task implementation
Ties the DELETE task http endpoint to the registry and marks tasks as cancelled.
Further, it tracks the timeout for a task and marks expired as cancelled.
2025-01-27 23:02:06 +00:00
Riccardo Schirone ddc13f787d orchestrator: introduce the "scheduler" component (#25)
* orchestrator/scheduler: initial implementation
* orchestrator/scheduler: mock libpng
* orchestrator/scheduler: process each type of msg independently
2025-01-27 15:55:59 +01:00
2over12 ac2b747e54 Adds source path to BuildRequest (#31)
* add source dir

* add to test script

* add to compose

* fuzzer test porfile, add source_path

* snapshot source dir to avoid races

* format
2025-01-27 08:01:13 -05:00
Riccardo Schirone cbd29e9bce orchestrator: create Downloader and TaskRegistry (#9)
* orchestrator: convert CRS API Task into internal representation
* better split downloader/task-server
* orchestrator: add tasks registry
* orchestrator: add tests for downloader
* orchestrator: add basic README
* orchestrator: update docker
* orchestrator: set SourceDetail.path
2025-01-24 14:15:26 +01:00
Riccardo Schirone ce11433e2b common: expand ReliableQueue (#11)
* common: move protobufs to common to be used by all components
* common: check same-reader pending list and autoclaim
* common: add claim_item method
* common: refactor queue/group names into Enums
* common: add generic typing for reliablequeue
* common: make the pending items list check non-default
* common: use item_id directly in ack_item
2025-01-23 09:32:18 +01:00