dash

package
v0.0.0-...-a343a40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BugStatusFixed = 1000 + iota
	BugStatusInvalid
	BugStatusDup
)
View Source
const (
	ReproLevelNone = dashapi.ReproLevelNone
	ReproLevelSyz  = dashapi.ReproLevelSyz
	ReproLevelC    = dashapi.ReproLevelC
)
View Source
const (
	BugStatusOpen = iota
)
View Source
const (
	MaxStringLen = 1024
)

Variables

View Source
var ErrAccess = errors.New("unauthorized")

Functions

This section is empty.

Types

type APIHandler

type APIHandler func(c context.Context, r *http.Request, payload []byte) (interface{}, error)

type APINamespaceHandler

type APINamespaceHandler func(c context.Context, ns string, r *http.Request, payload []byte) (interface{}, error)

type AccessLevel

type AccessLevel int
const (
	AccessPublic AccessLevel = iota + 1
	AccessUser
	AccessAdmin
)

type Bug

type Bug struct {
	Namespace      string
	Seq            int64 // sequences of the bug with the same title
	Title          string
	Status         int
	DupOf          string
	NumCrashes     int64
	NumRepro       int64
	ReproLevel     dashapi.ReproLevel
	HasReport      bool
	FirstTime      time.Time
	LastTime       time.Time
	LastSavedCrash time.Time
	LastReproTime  time.Time
	Closed         time.Time
	Reporting      []BugReporting
	Commits        []string
	HappenedOn     []string `datastore:",noindex"` // list of managers
	PatchedOn      []string `datastore:",noindex"` // list of managers
}

type BugReporting

type BugReporting struct {
	Name       string // refers to Reporting.Name
	ID         string // unique ID per BUG/BugReporting used in commucation with external systems
	ExtID      string // arbitrary reporting ID that is passed back in dashapi.BugReport
	Link       string
	CC         string // additional emails added to CC list (|-delimited list)
	CrashID    int64  // crash that we've last reported in this reporting
	ReproLevel dashapi.ReproLevel
	Reported   time.Time
	Closed     time.Time
}

type Build

type Build struct {
	Namespace         string
	Manager           string
	ID                string // unique ID generated by syz-ci
	Type              BuildType
	Time              time.Time
	OS                string
	Arch              string
	VMArch            string
	SyzkallerCommit   string
	CompilerID        string
	KernelRepo        string
	KernelBranch      string
	KernelCommit      string
	KernelCommitTitle string    `datastore:",noindex"`
	KernelCommitDate  time.Time `datastore:",noindex"`
	KernelConfig      int64     // reference to KernelConfig text entity
}

type BuildType

type BuildType int
const (
	BuildNormal BuildType = iota
	BuildFailed
	BuildJob
)

type Config

type Config struct {
	// See GlobalConfig.AccessLevel.
	AccessLevel AccessLevel
	// Name used in UI.
	DisplayTitle string
	// URL of a source coverage report for this namespace
	// (uploading/updating the report is out of scope of the system for now).
	CoverLink string
	// Per-namespace clients that act only on a particular namespace.
	Clients map[string]string
	// A unique key for hashing, can be anything.
	Key string
	// Mail bugs without reports (e.g. "no output").
	MailWithoutReport bool
	// How long should we wait before reporting a bug.
	ReportingDelay time.Duration
	// How long should we wait for a C repro before reporting a bug.
	WaitForRepro time.Duration
	// Managers contains some special additional info about syz-manager instances.
	Managers map[string]ConfigManager
	// Reporting config.
	Reporting []Reporting
	// TransformCrash hook is called when a manager uploads a crash.
	// The hook can transform the crash or discard the crash by returning false.
	TransformCrash func(build *Build, crash *dashapi.Crash) bool
	// NeedRepro hook can be used to prevent reproduction of some bugs.
	NeedRepro func(bug *Bug) bool
}

Per-namespace config.

func (*Config) ReportingByName

func (cfg *Config) ReportingByName(name string) *Reporting

type ConfigManager

type ConfigManager struct {
	Decommissioned bool   // The instance is no longer active.
	DelegatedTo    string // If Decommissioned, test requests should go to this instance instead.
	// Normally instances can test patches on any tree.
	// However, some (e.g. non-upstreamed KMSAN) can test only on a fixed tree.
	// RestrictedTestingRepo contains the repo for such instances
	// and RestrictedTestingReason contains a human readable reason for the restriction.
	RestrictedTestingRepo   string
	RestrictedTestingReason string
}

ConfigManager describes a single syz-manager instance. Dashboard does not generally need to know about all of them, but in some special cases it needs to know some additional information.

type Crash

type Crash struct {
	Manager     string
	BuildID     string
	Time        time.Time
	Reported    time.Time // set if this crash was ever reported
	Maintainers []string  `datastore:",noindex"`
	Log         int64     // reference to CrashLog text entity
	Report      int64     // reference to CrashReport text entity
	ReproOpts   []byte    `datastore:",noindex"`
	ReproSyz    int64     // reference to ReproSyz text entity
	ReproC      int64     // reference to ReproC text entity
	// Custom crash priority for reporting (greater values are higher priority).
	// For example, a crash in mainline kernel has higher priority than a crash in a side branch.
	// For historical reasons this is called ReportLen.
	ReportLen int64
}

type EmailConfig

type EmailConfig struct {
	Email              string
	Moderation         bool
	MailMaintainers    bool
	DefaultMaintainers []string
}

func (*EmailConfig) NeedMaintainers

func (cfg *EmailConfig) NeedMaintainers() bool

func (*EmailConfig) Type

func (cfg *EmailConfig) Type() string

func (*EmailConfig) Validate

func (cfg *EmailConfig) Validate() error

type ErrDontLog

type ErrDontLog error

type ExternalConfig

type ExternalConfig struct {
	ID string
}

func (*ExternalConfig) Type

func (cfg *ExternalConfig) Type() string

type FilterResult

type FilterResult int
const (
	FilterReport FilterResult = iota // Report bug in this reporting (default).
	FilterSkip                       // Skip this reporting and proceed to the next one.
	FilterHold                       // Hold off with reporting this bug.
)

type GlobalConfig

type GlobalConfig struct {
	// Min access levels specified hierarchically throughout the config.
	AccessLevel AccessLevel
	// Email suffix of authorized users (e.g. "@foobar.com").
	AuthDomain string
	// Google Analytics Tracking ID.
	AnalyticsTrackingID string
	// Global API clients that work across namespaces (e.g. external reporting).
	Clients map[string]string
	// List of emails blacklisted from issuing test requests.
	EmailBlacklist []string
	// Per-namespace config.
	// Namespaces are a mechanism to separate groups of different kernels.
	// E.g. Debian 4.4 kernels and Ubuntu 4.9 kernels.
	// Each namespace has own reporting config, own API clients
	// and bugs are not merged across namespaces.
	Namespaces map[string]*Config
	// Maps full repository address/branch to description of this repo.
	KernelRepos map[string]KernelRepo
}

There are multiple configurable aspects of the app (namespaces, reporting, API clients, etc). The exact config is stored in a global config variable and is read-only. Also see config_stub.go.

type JSONHandler

type JSONHandler func(c context.Context, r *http.Request) (interface{}, error)

type Job

type Job struct {
	Created   time.Time
	User      string
	CC        []string
	Reporting string
	ExtID     string // email Message-ID
	Link      string // web link for the job (e.g. email in the group)
	Namespace string
	Manager   string
	BugTitle  string
	CrashID   int64

	// Provided by user:
	KernelRepo   string
	KernelBranch string
	Patch        int64 // reference to Patch text entity

	Attempts int // number of times we tried to execute this job
	Started  time.Time
	Finished time.Time // if set, job is finished

	// Result of execution:
	CrashTitle  string // if empty, we did not hit crash during testing
	CrashLog    int64  // reference to CrashLog text entity
	CrashReport int64  // reference to CrashReport text entity
	BuildID     string
	Error       int64 // reference to Error text entity, if set job failed

	Reported bool // have we reported result back to user?
}

Job represent a single patch testing job for syz-ci. Later we may want to extend this to other types of jobs (hense the generic name):

  • test of a committed fix
  • reproduce crash
  • test that crash still happens on HEAD
  • crash bisect

Job has Bug as parent entity.

type KernelRepo

type KernelRepo struct {
	// Alias is a short, readable name of a kernel repository.
	Alias string
	// ReportingPriority says if we need to prefer to report crashes in this
	// repo over crashes in repos with lower value. Must be in [0-9] range.
	ReportingPriority int
}

type Manager

type Manager struct {
	Namespace      string
	Name           string
	Link           string
	CurrentBuild   string
	FailedBuildBug string
	LastAlive      time.Time
	CurrentUpTime  time.Duration
}

type ManagerStats

type ManagerStats struct {
	Date             int // YYYYMMDD
	MaxCorpus        int64
	MaxCover         int64
	TotalFuzzingTime time.Duration
	TotalCrashes     int64
	TotalExecs       int64
}

ManagerStats holds per-day manager runtime stats. Has Manager as parent entity. Keyed by Date.

type Reporting

type Reporting struct {
	// See GlobalConfig.AccessLevel.
	AccessLevel AccessLevel
	// A unique name (the app does not care about exact contents).
	Name string
	// Name used in UI.
	DisplayTitle string
	// Filter can be used to conditionally skip this reporting or hold off reporting.
	Filter ReportingFilter
	// How many new bugs report per day.
	DailyLimit int
	// Type of reporting and its configuration.
	// The app has one built-in type, EmailConfig, which reports bugs by email.
	// And ExternalConfig which can be used to attach any external reporting system (e.g. Bugzilla).
	Config ReportingType
}

One reporting stage.

type ReportingFilter

type ReportingFilter func(bug *Bug) FilterResult

type ReportingState

type ReportingState struct {
	Entries []ReportingStateEntry
}

ReportingState holds dynamic info associated with reporting.

type ReportingStateEntry

type ReportingStateEntry struct {
	Namespace string
	Name      string
	// Current reporting quota consumption.
	Sent int
	Date int // YYYYMMDD
}

type ReportingType

type ReportingType interface {
	// Type returns a unique string that identifies this reporting type (e.g. "email").
	Type() string
	// NeedMaintainers says if this reporting requires non-empty maintainers list.
	NeedMaintainers() bool
	// Validate validates the current object, this is called only during init.
	Validate() error
}

type Text

type Text struct {
	Namespace string
	Text      []byte `datastore:",noindex"` // gzip-compressed text
}

Text holds text blobs (crash logs, reports, reproducers, etc).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL