mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-23 03:19:51 +00:00
Pass baseline config around
Add new new Syzkaller configuration option kernel_baseline_config. This option is supposed to be used by kernel configruation bisection as a "good" config" Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com> Signed-off-by: Jouni Hogander <jouni.hogander@unikie.com>
This commit is contained in:
parent
bed103955b
commit
d42301aa2f
@ -29,13 +29,14 @@ type Config struct {
|
||||
}
|
||||
|
||||
type KernelConfig struct {
|
||||
Repo string
|
||||
Branch string
|
||||
Commit string
|
||||
Cmdline string
|
||||
Sysctl string
|
||||
Config []byte
|
||||
Userspace string
|
||||
Repo string
|
||||
Branch string
|
||||
Commit string
|
||||
Cmdline string
|
||||
Sysctl string
|
||||
Config []byte
|
||||
BaselineConfig []byte
|
||||
Userspace string
|
||||
}
|
||||
|
||||
type SyzkallerConfig struct {
|
||||
|
@ -370,6 +370,16 @@ func (jp *JobProcessor) bisect(job *Job, mgrcfg *mgrconfig.Config) error {
|
||||
if err := instance.OverrideVMCount(mgrcfg, bisect.NumTests); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var baseline []byte
|
||||
var err error
|
||||
// Read possible baseline for config minimization
|
||||
if len(mgr.mgrcfg.KernelBaselineConfig) != 0 {
|
||||
baseline, err = ioutil.ReadFile(mgr.mgrcfg.KernelBaselineConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
trace := new(bytes.Buffer)
|
||||
cfg := &bisect.Config{
|
||||
Trace: io.MultiWriter(trace, log.VerboseWriter(3)),
|
||||
@ -377,13 +387,14 @@ func (jp *JobProcessor) bisect(job *Job, mgrcfg *mgrconfig.Config) error {
|
||||
Fix: req.Type == dashapi.JobBisectFix,
|
||||
BinDir: jp.cfg.BisectBinDir,
|
||||
Kernel: bisect.KernelConfig{
|
||||
Repo: mgr.mgrcfg.Repo,
|
||||
Branch: mgr.mgrcfg.Branch,
|
||||
Commit: req.KernelCommit,
|
||||
Cmdline: mgr.mgrcfg.KernelCmdline,
|
||||
Sysctl: mgr.mgrcfg.KernelSysctl,
|
||||
Config: req.KernelConfig,
|
||||
Userspace: mgr.mgrcfg.Userspace,
|
||||
Repo: mgr.mgrcfg.Repo,
|
||||
Branch: mgr.mgrcfg.Branch,
|
||||
Commit: req.KernelCommit,
|
||||
Cmdline: mgr.mgrcfg.KernelCmdline,
|
||||
Sysctl: mgr.mgrcfg.KernelSysctl,
|
||||
Config: req.KernelConfig,
|
||||
BaselineConfig: baseline,
|
||||
Userspace: mgr.mgrcfg.Userspace,
|
||||
},
|
||||
Syzkaller: bisect.SyzkallerConfig{
|
||||
Repo: jp.syzkallerRepo,
|
||||
|
@ -108,6 +108,8 @@ type ManagerConfig struct {
|
||||
Compiler string `json:"compiler"`
|
||||
Userspace string `json:"userspace"`
|
||||
KernelConfig string `json:"kernel_config"`
|
||||
// Baseline config for bisection, see pkg/bisect.KernelConfig.BaselineConfig
|
||||
KernelBaselineConfig string `json:"kernel_baseline_config"`
|
||||
// File with kernel cmdline values (optional).
|
||||
KernelCmdline string `json:"kernel_cmdline"`
|
||||
// File with sysctl values (e.g. output of sysctl -a, optional).
|
||||
|
1
syz-ci/testdata/example.cfg
vendored
1
syz-ci/testdata/example.cfg
vendored
@ -15,6 +15,7 @@
|
||||
"compiler": "/syzkaller/gcc/bin/gcc",
|
||||
"userspace": "/syzkaller/wheezy",
|
||||
"kernel_config": "/syzkaller/kasan.config",
|
||||
"kernel_baseline_config": "/syzkaller/kasan_baseline.config",
|
||||
"manager_config": {
|
||||
"target": "linux/amd64",
|
||||
"sandbox": "namespace",
|
||||
|
Loading…
Reference in New Issue
Block a user