syzkaller: github.com/google/syzkaller/dashboard/app Index | Files

package dash

import "github.com/google/syzkaller/dashboard/app"

Index

Package Files

access.go admin.go api.go config.go entities.go handler.go jobs.go main.go noaetest.go reporting.go reporting_email.go reporting_external.go

Constants

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

Variables

var ErrAccess = errors.New("unauthorized")

type APIHandler Uses

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

type APINamespaceHandler Uses

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

type AccessLevel Uses

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

type BisectStatus Uses

type BisectStatus int
const (
    BisectNot BisectStatus = iota
    BisectPending
    BisectError
    BisectYes
)

type Bug Uses

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
    BisectCause    BisectStatus
    BisectFix      BisectStatus
    HasReport      bool
    NeedCommitInfo bool
    FirstTime      time.Time
    LastTime       time.Time
    LastSavedCrash time.Time
    LastReproTime  time.Time
    FixTime        time.Time // when we become aware of the fixing commit
    LastActivity   time.Time // last time we observed any activity related to the bug
    Closed         time.Time
    Reporting      []BugReporting
    Commits        []string // titles of fixing commmits
    CommitInfo     []Commit // additional info for commits (for historical reasons parallel array to Commits)
    HappenedOn     []string // list of managers
    PatchedOn      []string `datastore:",noindex"` // list of managers
    UNCC           []string // don't CC these emails on this bug
}

type BugReporting Uses

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
    Auto       bool               // was it auto-upstreamed/obsoleted?
    ReproLevel dashapi.ReproLevel // may be less then bug.ReproLevel if repro arrived but we didn't report it yet
    OnHold     time.Time          // if set, the bug must not be upstreamed
    Reported   time.Time
    Closed     time.Time
}

type Build Uses

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
    SyzkallerCommitDate time.Time
    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 Uses

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

type Commit Uses

type Commit struct {
    Hash       string
    Title      string
    Author     string
    AuthorName string
    CC         string `datastore:",noindex"` // (|-delimited list)
    Date       time.Time
}

type Config Uses

type Config struct {
    // See GlobalConfig.AccessLevel.
    AccessLevel AccessLevel
    // Name used in UI.
    DisplayTitle string
    // Unique string that allows to show "similar bugs" across different namespaces.
    // Similar bugs are shown only across namespaces with the same value of SimilarityDomain.
    SimilarityDomain 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
    // If set, successful fix bisections will auto-close the bug.
    FixBisectionAutoClose bool
    // 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
    // List of kernel repositories for this namespace.
    // The first repo considered the "main" repo (e.g. fixing commit info is shown against this repo).
    // Other repos are secondary repos, they may be tested or not.
    // If not tested they are used to poll for fixing commits.
    Repos []KernelRepo
}

Per-namespace config.

func (*Config) ReportingByName Uses

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

type ConfigManager Uses

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
    // If a bug happens only on this manager, this overrides global obsoleting settings.
    // See ObsoletingConfig for details.
    ObsoletingMinPeriod time.Duration
    ObsoletingMaxPeriod time.Duration
    // Determines if fix bisection should be disabled on this manager.
    FixBisectionDisabled bool
}

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 Uses

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 Uses

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

func (*EmailConfig) Type Uses

func (cfg *EmailConfig) Type() string

func (*EmailConfig) Validate Uses

func (cfg *EmailConfig) Validate() error

type ErrDontLog Uses

type ErrDontLog struct {
    // contains filtered or unexported fields
}

type ErrRedirect Uses

type ErrRedirect struct {
    // contains filtered or unexported fields
}

type ExternalConfig Uses

type ExternalConfig struct {
    ID string
}

func (*ExternalConfig) Type Uses

func (cfg *ExternalConfig) Type() string

type FilterResult Uses

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 Uses

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
    // URL prefix of source coverage reports.
    // Dashboard will append manager_name.html to that prefix.
    // syz-ci can upload these reports to GCS.
    CoverPath 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
    // Bug obsoleting settings. See ObsoletingConfig for details.
    Obsoleting ObsoletingConfig
    // Namespace that is shown by default (no namespace selected yet).
    DefaultNamespace 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
}

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 Uses

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

type Job Uses

type Job struct {
    Type      JobType
    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
    Commits     []Commit
    BuildID     string
    Log         int64 // reference to Log text entity
    Error       int64 // reference to Error text entity, if set job failed
    Flags       JobFlags

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

Job represent a single patch testing or bisection job for syz-ci. Later we may want to extend this to other types of jobs:

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

Job has Bug as parent entity.

type JobFlags Uses

type JobFlags int64
const (
    // Parallel to dashapi.JobDoneFlags, see comments there.
    BisectResultMerge JobFlags = 1 << iota
    BisectResultNoop
    BisectResultRelease
)

type JobType Uses

type JobType int
const (
    JobTestPatch JobType = iota
    JobBisectCause
    JobBisectFix
)

type KernelRepo Uses

type KernelRepo struct {
    URL    string
    Branch string
    // 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
    // Additional CC list to add to all bugs reported on this repo.
    CC  []string
}

type Manager Uses

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

type ManagerStats Uses

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 ObsoletingConfig Uses

type ObsoletingConfig struct {
    MinPeriod         time.Duration
    MaxPeriod         time.Duration
    NonFinalMinPeriod time.Duration
    NonFinalMaxPeriod time.Duration
}

ObsoletingConfig describes how bugs without reproducer should be obsoleted. First, for each bug we conservatively estimate period since the last crash when we consider it stopped happenning. This estimation is based on the first/last time and number and rate of crashes. Then this period is capped by MinPeriod/MaxPeriod. Then if the period has elapsed since the last crash, we obsolete the bug. NonFinalMinPeriod/NonFinalMaxPeriod (if specified) are used to cap bugs in non-final reportings. Additionally ConfigManager.ObsoletingMin/MaxPeriod override the cap settings for bugs that happen only on that manager. If no periods are specified, no bugs are obsoleted.

type Reporting Uses

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
    // Upstream reports into next reporting after this period.
    Embargo time.Duration
    // 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
    // contains filtered or unexported fields
}

One reporting stage.

type ReportingFilter Uses

type ReportingFilter func(bug *Bug) FilterResult

func ConstFilter Uses

func ConstFilter(result FilterResult) ReportingFilter

type ReportingState Uses

type ReportingState struct {
    Entries []ReportingStateEntry
}

ReportingState holds dynamic info associated with reporting.

type ReportingStateEntry Uses

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

type ReportingType Uses

type ReportingType interface {
    // Type returns a unique string that identifies this reporting type (e.g. "email").
    Type() string
    // Validate validates the current object, this is called only during init.
    Validate() error
}

type TerminalBug Uses

type TerminalBug struct {
    Status    int
    Subpage   string
    Caption   string
    ShowPatch bool
}

type Text Uses

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

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

Package dash imports 27 packages (graph). Updated 2019-12-12. Refresh now. Tools for package owners.