Documentation ¶
Overview ¶
Package csource generates [almost] equivalent C programs from syzkaller programs.
Index ¶
- func Build(target *prog.Target, src []byte) (string, error)
- func BuildFile(target *prog.Target, src string) (string, error)
- func BuildNoWarn(target *prog.Target, src []byte) (string, error)
- func Format(src []byte) ([]byte, error)
- func PrintAvailableFeaturesFlags()
- func Write(p *prog.Prog, opts Options) ([]byte, error)
- type Feature
- type Features
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFile ¶
BuildFile builds a C/C++ program from file src and returns name of the resulting binary.
func BuildNoWarn ¶
BuildNoWarn is the same as Build, but ignores all compilation warnings. Should not be used in tests, but may be used e.g. when we are bisecting and potentially using an old repro with newer compiler, or a compiler that we never seen before. In these cases it's more important to build successfully.
func PrintAvailableFeaturesFlags ¶
func PrintAvailableFeaturesFlags()
Types ¶
type Options ¶
type Options struct { Threaded bool `json:"threaded,omitempty"` Collide bool `json:"collide,omitempty"` Repeat bool `json:"repeat,omitempty"` RepeatTimes int `json:"repeat_times,omitempty"` // if non-0, repeat that many times Procs int `json:"procs"` Sandbox string `json:"sandbox"` Fault bool `json:"fault,omitempty"` // inject fault into FaultCall/FaultNth FaultCall int `json:"fault_call,omitempty"` FaultNth int `json:"fault_nth,omitempty"` // These options allow for a more fine-tuned control over the generated C code. EnableTun bool `json:"tun,omitempty"` EnableNetDev bool `json:"netdev,omitempty"` EnableNetReset bool `json:"resetnet,omitempty"` EnableCgroups bool `json:"cgroups,omitempty"` EnableBinfmtMisc bool `json:"binfmt_misc,omitempty"` EnableCloseFds bool `json:"close_fds"` UseTmpDir bool `json:"tmpdir,omitempty"` HandleSegv bool `json:"segv,omitempty"` // Generate code for use with repro package to prints log messages, // which allows to detect hangs. Repro bool `json:"repro,omitempty"` Trace bool `json:"trace,omitempty"` }
Options control various aspects of source generation. Dashboard also provides serialized Options along with syzkaller reproducers.
func DefaultOpts ¶
func DeserializeOptions ¶
Click to show internal directories.
Click to hide internal directories.