From 2f5f1db0db1f22514aab286170729e6b896d543e Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Sun, 14 Jun 2020 17:32:57 +0000 Subject: [PATCH] Add docker timeout to artifact configuration --- CHANGELOG.md | 7 +++++++ config/config.go | 4 ++++ debug.go | 4 ++++ pew.go | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31425e2..7a1b267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Parameter `--docker-timeout` may also be set in the artifact + configuration file. + ## [1.3.0] 2020-05-30 ### Added diff --git a/config/config.go b/config/config.go index 3c50672..a510db0 100644 --- a/config/config.go +++ b/config/config.go @@ -115,6 +115,10 @@ type Artifact struct { Timeout Duration } + Docker struct { + Timeout Duration + } + Mitigations struct { DisableSmep bool DisableSmap bool diff --git a/debug.go b/debug.go index 9e98192..65fefa0 100644 --- a/debug.go +++ b/debug.go @@ -113,6 +113,10 @@ func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string, q.Memory = ka.Qemu.Memory } + if ka.Docker.Timeout.Duration != 0 { + dockerTimeout = ka.Docker.Timeout.Duration + } + q.SetKASLR(false) // set KASLR to false by default because of gdb q.SetSMEP(!ka.Mitigations.DisableSmep) q.SetSMAP(!ka.Mitigations.DisableSmap) diff --git a/pew.go b/pew.go index 4f384c3..49af13c 100644 --- a/pew.go +++ b/pew.go @@ -325,6 +325,10 @@ func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact, q.Memory = ka.Qemu.Memory } + if ka.Docker.Timeout.Duration != 0 { + dockerTimeout = ka.Docker.Timeout.Duration + } + q.SetKASLR(!ka.Mitigations.DisableKaslr) q.SetSMEP(!ka.Mitigations.DisableSmep) q.SetSMAP(!ka.Mitigations.DisableSmap)