Skip to content

Commit

Permalink
tools/syz-reprolist: rename tool to syz-db-export
Browse files Browse the repository at this point in the history
  • Loading branch information
tarasmadan committed Nov 11, 2024
1 parent 1c02d27 commit 75bb1b3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dashboard/app/batch_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

func initBatchProcessors() {
http.HandleFunc("/cron/batch_coverage", handleBatchCoverage)
http.HandleFunc("/cron/batch_reproexport", handleBatchReproExport)
http.HandleFunc("/cron/batch_db_export", handleBatchDBExport)
}

// from https://cloud.google.com/batch/docs/samples/batch-create-script-job
Expand Down
8 changes: 4 additions & 4 deletions dashboard/app/batch_reproexport.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

const exportTimeoutSeconds = 60 * 60 * 6

func handleBatchReproExport(w http.ResponseWriter, r *http.Request) {
func handleBatchDBExport(w http.ResponseWriter, r *http.Request) {
ctx := appengine.NewContext(r)
for ns, nsConfig := range getConfig(ctx).Namespaces {
if nsConfig.ReproExportPath == "" {
Expand All @@ -23,19 +23,19 @@ func handleBatchReproExport(w http.ResponseWriter, r *http.Request) {
Scopes: []string{"https://www.googleapis.com/auth/userinfo.email"},
}
if err := createScriptJob(ctx, "syzkaller", "export-repro",
exportReproScript(ns, nsConfig.ReproExportPath), exportTimeoutSeconds, serviceAccount); err != nil {
exportDBScript(ns, nsConfig.ReproExportPath), exportTimeoutSeconds, serviceAccount); err != nil {
log.Errorf(ctx, "createScriptJob: %s", err.Error())
}
}
}

func exportReproScript(srcNamespace, archivePath string) string {
func exportDBScript(srcNamespace, archivePath string) string {
return "\n" +
"git clone -q --depth 1 --branch master --single-branch https://github.com/google/syzkaller\n" +
"cd syzkaller\n" +
"token=$(gcloud auth print-access-token)\n" +
"CI=1 ./tools/syz-env \"" + // CI=1 to suppress "The input device is not a TTY".
"go run ./tools/syz-reprolist/... -namespace " + srcNamespace + " -output export -token $token -j 10 && " +
"go run ./tools/syz-db-export/... -namespace " + srcNamespace + " -output export -token $token -j 10 && " +
"tar -czf export.tar.gz ./export/ && " +
"gsutil -q -m cp export.tar.gz " + archivePath +
"\""
Expand Down
2 changes: 1 addition & 1 deletion dashboard/app/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ cron:
- url: /cron/batch_coverage?days=true&months=true&steps=10
schedule: every 24 hours
# Export reproducers every week.
- url: /cron/batch_reproexport
- url: /cron/batch_db_export
schedule: every saturday 00:00
12 changes: 6 additions & 6 deletions tools/syz-reprolist/README.md → tools/syz-db-export/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Syzbot DB export
Every week syzbot runs syz-reprolist to export its databases:
Every week syzbot runs syz-db-export to export its databases:
1. [Upstream Linux](https://syzkaller.appspot.com/upstream)
db is [here](https://storage.googleapis.com/artifacts.syzkaller.appspot.com/shared-files/repro-export/upstream.tar.gz).
2. Contact us if you want see others.

## Export structure
DB currently includes:
1. First C-Reproducer for every bug.
1. Bugs descriptions.
2. First C-Reproducer for every bug.

It doesn't include:
1. Second+ C-Reproducers for every bug.
2. Syz-Reproducers.
3. Bugs description itself.
4. Any reproducer related metadata (like triggering requirements).
3. Any reproducer related metadata (like triggering requirements).

## How to export more data

The best way to see more data exported is to modify the tool and send us PR with your changes.

To reproduce locally what syzbot is doing for upstream Linux:
```golang
go run ./tools/syz-reprolist/... -namespace upstream
go run ./tools/syz-db-export/... -namespace upstream
```
Extending tools/syz-reprolist you can teach syzbot to export more.
Extending tools/syz-db-export you can teach syzbot to export more.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
flagOutputDir = flag.String("output", "export", "output dir")
flagNamespace = flag.String("namespace", "upstream", "target namespace")
flagToken = flag.String("token", "", "gcp bearer token to disable throttling (contact syzbot first)\n"+
"usage example: ./tools/syz-bot-export -namespace upstream -token $(gcloud auth print-access-token)")
"usage example: ./tools/syz-db-export -namespace upstream -token $(gcloud auth print-access-token)")
flagParallel = flag.Int("j", 2, "number of parallel threads")
flagVerbose = flag.Bool("v", false, "verbose output")
)
Expand Down

0 comments on commit 75bb1b3

Please sign in to comment.